Offices can be a veritable Petri dish for developing friendships: You’re in close proximity with people your own age, there is lunch to be had every day, and there is stress to be hashed out at happy hour.

In the meantime, your coworkers get to know a lot about you. They see you crossing off days until your vacation in Costa Rica. They hear the story behind the photo of you and your significant other that’s propped next to your computer screen. They listen when you talk about what you want to do next–the raise you want, the promotion you hope is on the horizon.

And then one of you gets laid off. The one left with a job goes silent, awkward and guilty. The one laid off gets resentful and similarly silent. But you miss each other, and realize that the other person was genuinely cool and you’d like to stay friends. This happened to me recently, and the following three steps paved the way for us to turn from ex-coworkers into friends:

Step 1: The laid-off person must get over it.

I’m not going to sugarcoat: This part sucks. As the one without the job, I was bitter. I was poor. I was not finding work. And I had to do something pretty corny to get over it: I started training for a half marathon, adding a positive structure to my long days of job search. I ended up running the half marathon, promising myself I’d leave any hang-ups about my old workplace at the finish line. In the end I was sweaty, sore, and finally over my last job.

Step 2: Don’t let the elephant stay in the room.

After–and only after!–you have achieved step one will you be ready to get together with your ex-coworker (and hopefully soon-to-be real friend). Don’t be weirdly formal. If the two of you liked to toss ‘em back, suggest some after-work drinks. And after you hug and ask how things are, don’t let the elephant sit in the room too long. Let her talk about the stresses of your old workplace, and share how you’ve been coping since you’ve lost your job. Most importantly, tell your ex-coworker that you’re over it. I shared my half marathon story, and it helped both of us relax.

Step 3: Embrace new common ground.

Don’t stay in Step 2 territory for too long. Griping about work was what the two of you used to do. Look for an opening as you catch up. One of my favorite ex-coworkers mentioned an eventful vacation that kept us talking for an hour. As soon as we realized we could create our own Petri dish of friendship, we were confident that we wanted to get together again.