What do I have to do after I got laid off, if I want to stay in the United States?

You have to change to another non-immigrant status such as F-1, F-2, H-4 etc. immediately. If you file your change of status application in time, you will be allowed to stay within the U.S. while your case is pending.