But alas, you're not a psychic. Sometimes when you think you're about to be promoted - like, you've practically uncorked the champagne - you'll be wrong. And your coworker will get the position instead.
You likely know what not to do in this situation: storm into your coworker's cubicle, or your boss' office, and demand that they rethink the decision.
Figuring out what is appropriate in this situation is somewhat harder. According to Rosalinda Oropeza Randall, an etiquette and civility expert and the author of "Don't Burp in the Boardroom," the general rule is to "be very mature."
That doesn't mean you can't have feelings. "Go take a walk. Have your little pity party for 10 minutes," Randall said.
But then you'll want to make an appointment to see your manager (or whoever made the decision). They'll be able to help clarify why they chose your coworker for the promotion, Randall said.
"You don't know your coworker's background," she added. Maybe they've been taking night courses, and that tipped the scale.
Or, alternatively, your manager may say they've had their eye on you for another position that's a better fit.
"Before you make a scene and really ruin your professional reputation," Randall said, "find out first."
Finally, you'll want to congratulate your coworker, or at least acknowledge their big win.
It's okay to use some humor, Randall said - for example, "You really gave me a run for my money!"
Remember: Especially if they knew you were banking on this promotion, they might feel awkward, too.
Ultimately, it helps to keep your overall career in mind. Randall said this situation can be an opportunity to show how you handle defeat and disappointment - meaning if you approach it with grace, your manager might very well consider you for another promotion down the line.