There is something about success that is nearly impossible for most people to obtain because it requires a level of irrational optimism! People simply give up the first time they have a problem. That doesn't mean you do the same thing over and over but you simply don't give up just because you are having a problem. The entrepreneur keeps ticking away day after day to achieve his/her goals.
Failure is necessary to rule out paths that don't lead to success. There are those who see failure as the end while there are those who see failure as an opportunity. Being one of the later helps you maintain your optimism.
Each time failure occurs stop for a moment and analyze the situation. Is it caused by the environment, the process, the product, or you? A level of research and analysis leads to greater knowledge and understanding of what to improve.
Once you have completed your analysis you then make the necessary adjustments. Each success and failure tells you something about how things work and what is needed for success. Every time you adjust your model you get a step closer.
You don't fail until you give up! Each failure, review, change and effort leads one closer and closer to finding a path that works for success. Stick with it until you are rewarded for your efforts.