Try the following tips:
Judging your selfharshly now won't help you do better in the future.
Take the position of an observer. What if a good friend told you he had failed? Would you call him a failure?
Most probably you would emphasize his good points and help him put the situation in perspective.
The difference between a successful person and others is not a lack of strength, not a lack of knowledge, but rather a lack in will. - Vince Lombardi