I'm going to give a theory on why people tend to be afraid of failure, back it up with some anecdotal evidence and then give a recommendation on how you should react to failure in general.
Why we fear failure
When you're in school and you go to take a test or do homework, the general understanding is that you either pass or fail. It's a binary choice that once made, is mostly irreversible.
“Well, the test should be very easy if you've studied and there really is no excuse for failure. If you struggle you need to study more.” our hypothetical teacher might say.
And indeed, we accept this and move on. Students tend to either do well and pass, or fail. Passing earns praise, failure earns scorn and punishments, and in theory if you pass you'll continue to pass if you keep working hard and if you're failing it's because you aren't working hard enough.
Now, cut to real life or perhaps even a difficult college class. Success is not promised, and quite likely in spite of how hard you work. No amount of study guarantees success. What's changed?
Success and failure are no longer binary. Having failed no longer removes the ability to succeed. Likewise, having succeeded doesn't remove the option to still fail dramatically.
Success or failure are no longer a matter of simply having studied or done the homework. Random chance, the agency of other people, and generally doing the unknown offers plenty of chance for failure despite effort.
Some anecdotal evidence
It's generally held that students who do very well by the book in high school tend to suffer in college. This isn't always true, but in general shifting from high school and moving to college tends to mean moving from “X is the right answer” to having to argue, defend, and explore both sides to build a compelling case one way or another.
In short, we move from a situation where success is determined simply by studying and instead move to where success is contingent on being able to analyze failure.
Real life isn't like a class room. As a general course, people (including extremely successful people) will fail on a regular basis. Enough so that the common mantra of many startups is “fail quickly”. Outside of homework and tests the goal isn't to avoid failure, rather when we fail it's to analyze that failure and apply those learnings to our next attempt (and perhaps most importantly, to make a future attempt).
Failure isn't to avoided, rather it should be considered a step on the path to success. In another words:
If you aren't failing, you aren't trying hard enough.
Failure is an indication we are pushing ourselves outside of our comfort zone and it's only by doing that we can grow and go on to reap success. We don't become successful because we've somehow dodged the failure bullet, but because we've repeatedly failed, learned, and gotten back up and tried once more.
Turning failure into a step on the path of success
- Get back up
If you allow failure to be final, that is to say, if you don't get back up and move to the next step then you have actually failed. No failure is final unless you allow it to be.
Take a moment. Nobody likes failure. Sometimes we can just brush ourselves off and get back on the horse, but sometimes failure can have more consequences. Take a moment to get your bearings back.
Why did the failure occur? Was it preventable? What is the correct course of action to take next time? What are some theories about how to move towards success?
Basically, take step (3) and narrow it down into a course of action. Sometimes failure comes from a clear wrong turn and the steps are simple, sometimes failure is random and the correct action is to repeat the same thing you already did.
Put the plan into action. Move towards the goal again.
Of course, sometimes you will fail again. That's the nature of the beast, success doesn't always follow immediately after failure. The important step is to keep trying and to keep moving towards success instead of falling into a downward spiral.