Here’s a situation that is almost more painful to observe than it is to experience — almost. Imagine learning about the perfect job opening. The opportunity of a lifetime. Of course you pull out all the stops to make this job yours. Depending on the situation, that might mean:

Paying a service to create just the right application packet;

Reading everything possible about this organization, even when that means paying for downloads from websites.

Connecting with all your acquaintances and even your dreaded cousin Henry to find links into the company.

Paying for interview coaching, a new hairstyle and a new interview outfit.

You get the idea. The list of extra efforts could run for pages and sometimes does. Now imagine you’ve got the interview, you do well, you’ve got the second interview, has anything ever looked more hopeful?

After each stage, you carefully heed all the best advice regarding follow-up, and it seems to be working. You even learn the company has called your references. Nothing can stop you now!

Except something does. Somewhere along the line the process slows down, then grinds to a halt. You don’t hear back when you leave voice mails and your emails are answered with a curt, “We are still in process and will contact you when a decision is made.”

Which means what, exactly? That they’re interviewing more people? Searching for budget so they can make an offer? Maybe they found out something from your references that’s making them think twice. Your mind races over the possibilities but you can’t find anything out for sure. So you follow up some more, you ask your contact inside to check on things, and you wear a rut in the carpet walking aimlessly around the house.

When the thin envelope finally arrives you know instantly that it’s a rejection, because those tend to come by mail. You feel like a leper standing there holding the message no one could be bothered to give you over the phone, despite the countless hours you spent in conversations with them. Rats.

See? Didn’t I say that was almost as painful to observe as it is to experience? Just writing it makes me want to cry for someone. It’s incredibly frustrating and painful to put all your hopes into something and start building relationships only to be rejected at the end. Can anyone say “junior high school?”

If this has happened to you, or if you suspect it could, you’ll want to know what to do — after the therapy session or bottle of beer, that is. Like everything else in a job search, you’ll find that things go better when you have some steps to follow, so here you go:

1. Tie up the loose ends on this situation. Although it’s probably the last thing you feel like doing, the classy option is to write a “thank-you-for-considering-me” letter and send it to the main interviewer. A few complimentary lines extolling the thorough process and expressing your continued interest will be enough.

2. If feasible, find out what happened. If you have an inside contact, ask this person to talk with you briefly to help you understand what you could do better next time. If you don’t have that contact, however, it’s probably best to let this drop. At this point, any questions asked of the interviewer will look like reluctance to move on.

3. Take inventory. What did you learn that you can use in your next interviews? Perhaps you found out about a trend in your industry that leads you to consider additional companies to approach for work. Or maybe your big takeaway relates to your own interview performance.

4. Pat yourself on the back. You’d rather be number one on the candidate list, but getting as close as you did means you’re doing something right.

5. Vow not to get so attached next time. This is tough advice to give, because I want all candidates to put their hearts into every outreach. And yet, there has to be some balance. If you forsake the rest of your opportunities to chase just one, you run the risk of being dumped by the side of the road with no taxi to pick you up again.

6. Reconnect with this manager after you’re re-employed. Yup, this is just for gloating, but why shouldn’t you have that pleasure? Call it “networking” so they feel special, but go ahead and smile when you send out the news about the lucky company that gets to work with you.

Amy Lindgren owns Prototype Career Service, a career consulting firm in St. Paul, Minn. She can be reached at alindgren@prototypecareerservice.com or at 626 Armstrong Ave., St. Paul, MN 55102.