Failure is not failure just like success is not success:
If at first you don’t succeed, stop. Take a deep breath, and analyze what you’re doing. Continuous success is mostly the worst spoiler.
It keeps you so engrossed in the race that you have no time or inclination to give a second thought to the purpose of the whole goddamned race itself. Failure is an opportunity to do just that.
Since you failed, you have been left behind. That gives you the chance to see if your direction makes any sense at all or if you are merely a victim of forced labour, the target of an unintentional social conspiracy to make you follow the path, the truths, the standards of success and failure that society believes to be true and very badly wants to keep believing to be true, regardless of whether they are actually the most ridiculous of illusions.
Failure is something to be thankful for, since you might find out that the whole edifice on which the generally accepted concept of failure stands is nothing but a pile of crap. It gives you the time to find out where your actual success lies and what actual failures you should have been wary of. Failure is not failure just like success is not success. Your path might be at a tangent or even in a completely different dimension.
So, if you fail, stop, take a deep breath and analyze. Let the successful ones go by without as much as a glance towards them. They probably don’t know where they are going. And if at first you don’t succeed, try again, that is, take another deep breath and re-analyze.