"Welcome to the real world, where most of the time, things, don't go your fucking way." Gus - The Ref
Things don't always work out as planned or wanted. It may seem bad or painful at the time, but things like this can be viewed another way. They can be viewed as an opportunity.
Opportunity to experience something else, something beyond that which you wanted. Perhaps you will find something better. Perhaps there are things out there that you did not expect or know and are waiting. Things like that do happen.
It may also be an opportunity to find out who you are. Your strengths and your weaknesses. When something happens you did not want it challenges you to overcome, to adapt, and to examine how strong you really are. You may find that you have reserves of strength you did not know about, or you may find that things mattered more than you expected. These unexpected trials will cause you to look at yourself and come to a conclusion, what that conclusion is depends on you and the situation.
It is not a matter of survival, all situations can be tolerated and survived it is simply a matter of response and will. Even the darkest of moments can be overcome but it requires effort, strength, and time. Attitude is everything, if it is bad the more of the three are required, if the attitude is good it is less.
So... have a good attitude, take things as they come, make unwanted things challenges, and look for the good in all situations. Things aren't as bad as they seem sometimes, look at what you have, not what you have not. Even if you do not get what you want you may already have enough... more than enough... more than you could ever hope for... the best of something.