It's important to emphasize that failure does not diminish the goal or the attempt. Most (all?) of us are afraid to fail. So we don't attempt (and not attempting is worse than failing, I think) or we attempt timidly (and thus increase our chances of failing) or we quit after our first failure.
My approach to overcoming the fear of failure is to remind myself that one of my life goals should be to fail often. Fail as many times as I can, as quickly as I can. Try different approaches. Learn different ideas. Maybe I was just unlucky in my first five attempts. Try, try, try.
Consider Gerald M. Weinberg's take on failure:
[S]ooner or later everybody stumbles. It helps to understand why you stumble, but most important things can be explained only in jokes, riddles, and paradoxes. Survival requires that we learn to laugh things off and start over, which leads us to the next paradox: The business of life is too important to be taken seriously.Seriously, where did we get such a ridiculously serious idea that we won't fail ever?