The best way I have found to stay motivated once I have started working is to get constantly give myself small dopamine hits. I try to Always be shipping tiny changes, to Iterate as fast as possible and to Measure output, not outcomes to make that happen.
The idea is from the great book “The Motivation Myth”, which I thoroughly enjoyed. Here are some quotes from the book itself about this:
“Motivation isn’t something you have. Motivation is something you get, from yourself, automatically, from feeling good about achieving small successes.”
“If you want to stay motivated, if you want to stay on track, if you want to keep making progress toward the things you hope to achieve, the key is to enjoy small, seemingly minor successes—but on a regular basis.”