It is awful to judge yourself based on your past failures. We must overcome the negative connotation connected to failing, because honestly, failure is a part of the process of becoming successful. The first step to success is acknowledging your own failures, and realizing that everybody fails sometimes. Failure does not mean you won't eventually succeed. Sometimes failures are even necessary for your success in a particular area. A positive way to look at your failures is as if they are stepping stones for you to make it to the other side of the creek–to your own success.
Sometimes the pressures to succeed in school, at work, or in life in general, are just too much for us to handle. Take it from me--a living, breathing ball of anxiety--that pressures can basically immobilize you and cause you to not be able to progress in anything. There are dangers associated with high expectations and the pressure to succeed. If you find yourself being crushed by the expectation to exceed, seek help. Failure is sometimes inevitable and actually the only way to escape certain stress. I can say from personal experience that sometimes you have to fall to your lowest point to realize where you are in life and decide if you want to stay there.
For me, it happened my freshman year of college. It took me experiencing failure for me to realize that my major was definitely not right for me. Two semesters later, I am happy in my major and have been successful in all of my classes. Maybe in your case, turning failure into success looks something like having to hit rock bottom in your job or relationship to realize how to better yourself and rise up from the rubble.
It's hard to admit and accept our failures, especially if we committed a lot of time and effort to whatever failed. My advice is to be honest with yourself. Evaluate your situation and accept your failure. This is good for two reasons: it's a weight off of your shoulders, and you are now willing to leave the past in the past and move forward. I believe that a life lived comfortably without progression is a waste of potential. It is not healthy to wallow in self-pity, (although sometimes it seems like the only way to heal) so it is important to use your failures as a tool for success.
No matter where you are in relation to your past failures or how others see you after having failed, you have the opportunity and power to overcome and conquer. Do not allow failures to hold you back. Try, try again until you are where you want to be in life.