I think there are two ways of motivating yourself.
One is “internalised external authority”.
You create an authority figure in your head. It tells you what to do. It tells you when you’re good enough. And it tells you when you’ve screwed up.
To motivate yourself using your internalised external authority, just embody that voice for a moment. Work out some nice juicy judgements about yourself, as in: “You haven’t been working enough! You need to do this better! Get a better grade! Get a better promotion!”
Then, return to your main self and start working. If you slack off, use your internalised external authority to whip yourself into further action.