Each of us faces small or big failures in the course of our lives. But the idea is to get up, shake up a bit and get going. Staying motivated is the key.
Some other tricks -
Self Esteem and positve visualisation -
Positive strokes entailing thinking of all the wins in the past, the triumphant moments and the glorious feedback on outstanding work, glowing references - once you have been an excellent and above-the-target worker you tend to collect hordes of such gems in your kitty.
Get on to Plan B - all good workers will always have a Plan A and a Plan B and implement that effectively.
Circle of family and friends who tell it like it is, yet know your actual potential and stoke that in the right direction.
Promising self talk and introspective moments guiding you to learn from the failure and turn it into a good learning exercise that eggs you onto the next level.
Also, always facing the issue full on - with tears or other emotional display - and getting it all out so that one can start afresh with no extra baggage.