Hopefully you’ll never need it, but having a plan in place before you ever get fired or let go is a smart idea. You don’t want to lose your job and then be left with no idea what to do, who to turn to, or where to go. Taking a good look at your current life and figuring out what it is you really need and want–and when you need it–will help you feel less anxious if you’re ever let go from a job.

The first thing to do is not to panic. Though “thanks, but no thanks” is difficult to hear in any situation, losing a job today is not the way it was twenty years ago. Know that it probably won’t color any future interaction or offer you have with a business. What could color a future relationship is the way you respond to being let go. Control your emotions as best you can; don’t get angry, and certainly don’t do anything violent or that could damage the company. You’re not the first person this happened to, and you will get through this.

Then, after the paperwork is signed (and you have a little bit of room to negotiate on this, if you need to), file for unemployment benefits as soon as you get the chance. This depends on your situation and what you need, but unemployment benefits could be very useful to you between jobs, especially if your industry is a niche one with fewer openings. You’re probably eligible for such benefits even if you were fired rather than let go.

Think closely about your finances now. Review your budget for the next several months and cut whatever expenses you can do without. Make your doctor’s appointments now if you can—you’ll likely have a few weeks left on your former employer’s insurance, so be sure to get the most out of them. You likely also have the option to extend your health plan through the COBRA program. Take time to relax, if you can. What other things could you be pursuing at this time in your life?

Now, you can start to think about the job hunt. Looking for jobs after you’ve been fired doesn’t affect your chances the way it used to, and you don’t have to open each interview with an explanation of what happened at your last job. Chances are you won’t have to explain a bad reference, either, because the risk of being sued deters employers from giving them.

So relax, breathe, do the math, and trust that a new opportunity will present itself.