It is extremely important to have a strong connection with God. If you are a faithful person, you would be in a much better position to deal with success or failure in your life. No matter what religion you belong to, you should remember that nothing happens in this world without the will of God and your failure is a test by your creator and you have no option but to keep striving for the best. One must keep in mind that no worldly success or failure is permanent.
Spend time with your family and friends
After a failure, one of the best ways to motivate yourself is to spend time with the people who think positive about you. Talk to people you can trust, share your pain with them and they would try their best to motivate you.
Talk to your own self
For some people, it is highly recommended not to spend too much time in isolation after a failure as they have the tendency to go into depression.
If you are not of those people, it is necessary to spend some time with your own self and assess the situation.
Think about your past accomplishments
One can easily consider himself/herself to be a loser after a failure. If you are suffering from such a scenario, you should remind yourself about your past achievements and accomplishments. Thinking about past success will help you motivate yourself.
Take your failure as a lesson
One of the best ways to motivate yourself is to take your failure as a lesson and make sure that the mistakes you have committed are not repeated in future.