To stay motivated, you need to believe that you're in control of your life, and the decisions you make will affect how your future ends up. Put in a lot of effort to achieve your goals and stop blaming other factors but rather take responsibility.
And remember that each step you take, is a step closer to success. So don't disregard the little you do, because later on, they amount to much.