In any aspect of life, the main determining factor of how much raw progress we make is the sweat equity we put in. This is a fact, and it's something we all probably heard at some point, "you need to work hard at school to do well" "you need to work hard to get that promotion" etc. We hear it so much that we forget the meaning sometimes, and it is an extremely important part of a workout routine!
There are infinitely many ideologies on how to create, foster, and maintain motivation; from negative reinforcement (thinking of the consequences), to rewarding yourself, to positive reinforcement (thinking of the outcome you want), the list goes on! I am of the opinion that none of these are the best however, as they all only provide a temporary solution. Eventually when the times get tough, your brain will talk you out of your goals, the consequences won't seem so bad, and rewards can easily begin to become overly numerous without avid self control.
When it comes to working out, my methodology is simple, it all starts with perspective. Rather than trying to brute force past the mental barriers to motivation, look at them from a different angle and walk past them. The best way to do this in my opinion is to change what working out is for you. Make it less of a chore by using it as a release or even as a form of relaxation! When you are all bogged down with the world's problems and your life in general, work out to get away from it. You will soon discover that when things get tough, working out is an activity you turn to rather than run from! By changing your perception you can solve the motivation problem while simultaneously helping yourself de-stress, now go out there and get it done!