Let's face it we have all been faced with a time where we had to deal with failures because as a human race we can not avoid it. Its what you do in light of your failures that shows your true character.
I just want to put it out there you are so much more than your failures, you are strong, and you can do anything you put your mind to. At the end of the day no matter the outcome if you can look at yourself and say I gave it my absolute best shot then you've accomplished something in itself. It should not matter what the outcome is because you know that you did everything you could. This is something you should always try to strive towards.
It's ok to be upset... It's hard not to be upset when you fail like I said you are only human it is going to happen. Take whatever emotion you are feeling and turn it in to something positive. What I mean by this is often times after failure people feel the emotions of anger, sadness, etc take that emotion and realize you do not want to feel that way again and work even harder for the next time you try you do not have the negative emotion that comes along with failure.
Try again, with this one it sounds so basic but I still feel like I should address it because you could easily not want to try something again but you should because sometimes you need to go through a trial period to truly reach your greatest potential. Like the common quote says fall down 2 times get up 3 times.
You will survive this if you are anything like me I tend to be very dramatic at times and I act like I will not get through something just because I face failure. I tend to feel that I won't get past this and I struggle at working through whatever I failed at. Well I am here to say that not only will you survive you will be better because of failing. If you learn from your failures you get better and therefore you are better.