Failure is something, people are afraid of
When someone fails, they get depressed, and wrong thoughts rise in the mind
Failure is a opportunity
When someone fails, it's the way of the universe to tell you that, something is going wrong.
Take failure in a positive way, check where you are going wrong, and then plan the future
Instead of getting sad, I would say, enjoy the failure, look into it's eyes and say, I will beat you.