Some job seekers hate writing resumes. Others really hate interviewing. Nearly everyone hates rejection. Hearing "we have decided to move in a different direction" or "there were other candidates with experience that more closely matched our needs" from a prospective employer is not something everyone wakes up excited to go through. As unpleasant as a rejection can be, how you handle that rejection can impact the success of the rest of your search.
If you get the news over the phone, graciously thank the messenger with a smile on your face.
It is far more likely that you will get the rejection via an e-mail or an actual letter mailed to you.
Either way, send an e-mail or thank you note to the hiring manager thanking them for the opportunity to interview for the position. Wish them success without being sarcastic.
Don't expect to get feedback about what you could have done differently. Also don't expect to learn in what direction the hiring manager went. From their perspective, they have no responsibility to tell you anything more than the fact that you didn't get the job. They could have hired someone else or just not hired anyone at all.
Sometimes you didn't get the job because someone else did. Sometimes, however, it's because you are just not a good fit.
Through the interview process, the hiring manager will need to evaluate your experience and skills to determine if you can do the job. Equally as important, they will evaluate you to see if you will be a good cultural fit. You will likely never know if you didn't get a job because the hiring manager thought you weren't a good fit. Sometimes you need to trust that you might not have done well in that position.
A "no" now, can sometimes turn into a "yes" later. As a hiring manager, there have been several times when, after selecting a candidate, there has been a reason to hire an additional person. Handle the rejection poorly (aggressively asking for feedback, speaking negatively about the company or hiring manager) and you can be sure you will never get a chance to interview there again.
If you performed well in the interview and you are still looking 90 days later, you can follow up with the hiring manager. Again, it is important that stay positive and professional.
Bounce back. Don't let the rejection hurt your momentum. Keep your head up and keep working at it. Take out the emotion. Don't be upset. Don't take it personally.
Remember that every no is just a portion of a yes.