That moment when the boss says you are laid off actually can be good for you if you handle it right.
First, take a breath immediately and get control, according to SalaryTutor.com. Two things are true: The person telling you this doesn’t like to do it. You don’t like to hear it. Neither can be avoided. Reacting badly results in security being called. Reacting gracefully helps both of you and, in some ways, makes your boss your ally.
Second, listen for the plan. The decision has already been made so no negotiating will help you. But the company has already considered how they want you to leave: Immediately (look for the security guard) or a soft exit where you wrap up projects and maybe even train your replacement. If you can, get the terms in writing.
If you have private information on your computer, explain what it is that you wish to copy.
Third, if you are going to remain a few days or more, control the message. Send an email to friends and valued co-workers. Never talk poorly about your boss or the company. Never blame anyone. State the facts (job eliminated or laid off or ‘leaving the company’). Be upbeat about your plans. Tell people when you will be out of the office and invite them to visit you in the meantime. Invites eliminate some more awkward silences.