You're not being rejected. Your profile just doesn't fit right now.
A rejection almost always feels personal. That's human, but from the other side of the table I can tell you: most rejections have nothing to do with you as a person.
Positions are rarely filled by 'who is the best person overall', but by 'who fits best right now, at this very specific moment, with this team, this budget, this internal context that you as an applicant can't see at all'. Sometimes someone internal gets promoted after all. Sometimes the requirement profile changes at short notice. Sometimes the chemistry with another person is just slightly better, without saying anything about your qualifications.
That's not meant to downplay the disappointment, a rejection is allowed to hurt. But it shouldn't stop you from continuing to see yourself as valuable. A 'no' to a position is a 'no' to a fit, not a verdict on you as a person.
What you can do with it: actively ask for feedback. Many don't dare, but a short, polite follow-up shows professionalism and sometimes gives you real starting points. And if no answer comes: that's not a statement about you either, but about the company's capacity to communicate cleanly.
Take the rejection as information about a fit, not as a verdict on your worth. The difference is small in wording and huge in its effect on your self-image.

