If you don’t have the motivation to do something, it means you’re not clear about your real purpose.
That’s why you avoid it and waste time. You procrastinate. Because who cares. It doesn’t matter.
But procrastinating is a clear sign there’s no imminent danger. Therefore, it’s easy to not do it at all.
Figure out your purpose first. Align yourself with it. Do you really need to do what you’re supposed to do? Why?
If it still doesn’t work, try to do the opposite — which is not doing it at all.
“But if I don’t do it, I might experience the consequences.”
That’s the point. If you always motivate yourself, it’s likely you don’t understand the consequences of not doing it.
If you truly understand the consequences, you’re not here reading this — instead, you’re working on whatever you need to accomplish.
One solution to your procrastination or demotivation is to experience the consequences, to suffer from your mistakes. Then maybe… you finally learn from it.