I've been on the receiving end of getting let go more than once in my life. The hardest thing to do is not take it personally, even though you feel like a failure after it happens. A lot of times, there was literally nothing you could have done to prevent it.
One of my best friends growing up also got let go today. I was kind of surprised...he was in sales and told me his numbers were fine, and I thought that's all sales managers really gave a shit about. Guess not.
One time I was in Vegas in a sports book and struck up a random conversation with some guy next to me. He told me something that sticks with me to this day: every time you get your paycheck, you and your company are basically "even." I thought about it and it's true. You don't owe them anything else and they don't owe you anything else after every paycheck. There is no such thing as company loyalty anymore...it just doesn't exist. I wouldn't feel the least bit bad or guilty about leaving my current gig if I found one that's a better fit for me.
I read a story online about some guy who worked for the same company for 25 years...and how did they celebrate? By giving him a plaque, then firing him a few years later before he reached 30 with the company so they wouldn't have to give him retirement pay. The only security you have is what you make for yourself.
Off my soap box.