It happened. The worst case scenario. The thing you never thought would happen did. You’ve lost your job.

You’re on the wrong side of the merge. The business acquired a new company, and your position has been eliminated. You’ve been flying under the radar with mediocre work, and your under performance has caught up with you. You’re fired.

What to do when you lose your job?

It may be hard to see it now, but losing your job can be a gift. It can mean that you get to start over. Perhaps you’ve even been thinking about doing something else for a while, and now you get the chance.

What an exciting time to be you!

Ok, maybe I should pump the brakes a little bit on the excitement, but I’m not stopping the car.

It may not feel like a time to celebrate, but with the right action plan, you’ll be on your way to the next exciting chapter in your life. If you’re not sure where to begin, here’s what I recommend.

Get the right mindset

Try not to let this be a setback. Instead, think of losing your job as propelling you forward. Of course your immediate reaction may be panic, anger, frustration, and just being flat out pissed off.

And that reaction is perfectly acceptable. For 48 hours.

Then, you need to get to work—emotionally, and in your job search. Getting your head in the game with a positive frame of mind is the difficult but important work you must do to press onward.

As a starting point, consider writing a list of action steps you need to take to start your job search. Then, every morning, commit to advancing or completing one of those steps.

Figure out what you want to do next

This may be the hardest step of all because you’re faced with a world of options when you’ve lost your job. In my experience, the best way to figure out what you want to do next is to create two lists.

The first list should include all of the things that you like to do in your work. Maybe you like managing projects, or maybe you love creating new systems, or maybe you just love chatting with your coworkers. Think of all the things that bring you joy at work and write them down.

The second list should be all of the things that you hate to do in your work. This is usually the easiest list to make because it’s so easy to pinpoint what makes us feel uncomfortable or anxious.

Consider adding both practical and situational items to your list. For example, maybe you hate analyzing data in spreadsheets, and you also hate your 45 minute commute to work.

Now compare your lists and consider the jobs that you’re qualified for. Let the “like” list be your guide to what you should look for in your job search, and your “hate” list be your guide to what to watch out for when you start interviewing for jobs.

Update and polish your resume

The very first step you can take toward landing a new job after you’ve lost your job is updating your resume. I always recommend doing this when you are sitting pretty in your current role because it gives you time to thoughtfully write a great resume.

But, if you don’t have a great resume ready to pull off the shelf and submit to jobs once you find out that you’ve lost your job, then it’s best to seek out professional help.

Of course, you can turn to The Google and type in “resume template,” but you’ll quickly find that resume writing is something you should outsource to a professional.

Here’s why you should hire a resume writer.

You also need to make sure that you have a cover letter. This is an important document that you cannot skip including in your job applications. I’m serious, you can’t skip it.

Tell everyone your plan

You may feel very alone right now, but the worst thing you can do is isolate yourself. It’s community that helps lift you up during your most vulnerable times.

Once you tell your network your story, you may be surprised just how many people have been in your shoes and came out on the other side. It happens more often than you think.

Consider opening up to your friends and family about what’s going on and let them know about your plan. The more you tell people about your plan, the more you reinforce in your own mind that you’re taking action and you will succeed.

Telling your network is just as much about informing them about what’s going on with you as it is about mentally holding yourself accountable to completing the job search process.

Make your job search your new full-time job

On average it takes five months to find a new professional job. During those months you will go on an emotional roller coaster you never wanted to be on.

There will be ups. You’ll submit your resume to a ton of awesome jobs. You’ll get super excited that there are so many you qualify for.

And there will be downs. Even if you submit the perfect resume, you still only have about a 33% chance of getting the job. It’s a tough reality, but you have to keep going.

There will be times when you want to quit.

It’s easy to avoid that emotional roller coaster, but guess what? You don’t get the job if you don’t apply.

Stay the course. Refine your approach over and over again until you get the job you want.

Learn from this experience

We live in a time of unprecedented job growth and job loss. Every day there are new jobs being created that didn’t exist ten years ago, and every day there are jobs being eliminated as companies adjust their business models in this digital and consumer-first age.

Prepare yourself.

Once you get that new job, put your all into it. Make yourself an asset to the company right away. And, update your resume right away, so that you’ll never have to say, “I’ve lost my job, now what?”