It stinks to get a “thanks but no thanks” response after you’ve poured your heart and soul into a job. And it’s very easy to that that sort of thing personally.
But please try not to.
I know it feels like a rejection, but the truth is probably much more complicated than that. They may have had an internal candidate. They might have picked up on a cue that you would be unhappy in the job. Maybe you’re out of their price range. It’s possible that someone else had more experience in the field than you. There are, in short, a lot of reasons you may not get a job offer, and as hard as it is, please try not to take them personally.
If you think it’s a question of how you interview, there are lots of resources available to help with that, like these tips from Indeed, and these from WiseGeek. I advise being very, very specific and telling stories. That means actual stories: one time, this thing happened, and I did this, and the outcome was that. Not vague talking around things or generalizations, which I see a lot, but actual illustrations of events. If this stuff is hard for you, practice with friends or family who are likely to give you honest feedback. (Or, of course, reach out to a career professional like me!)
I also encourage my clients to ask for feedback after a no response from an employer. Most of the time you won’t get anything back, but every once in a while, you’ll get a great piece of info or advice.
And you know what? It’s okay to feel sad and frustrated and hurt and all that stuff. Acknowledge your disappointment, complain to your loved ones, maybe even indulge in a few tears. But remind yourself that none of this means you’re a failure, because it really doesn’t.
Finally, if they’ve said they’ll keep your resume in file, take that as a good sign! They don’t have a particular reason to say that if it isn’t true, and I frequently get surprised calls from people who have been asked to interview for another position at a company they’d thought wasn’t interested.