Sometimes we lose motivation, oftentimes it's because we either:
a) stop believing in ourselves
b) stop believing in our dreams
c) we failed that we lose this motivation.
Failing is minor: it's merely a chance to climb higher to the top by finding another solution to why you failed and how to fix it.
Losing belief is major: You're giving up on your dream and yourself. You don't think you have a higher purpose than you do so you need something to regain that courage.