I am very prone to what is called "burnout", a term referring to a developer getting tired or otherwise dissuaded from continuing to work on their project. This has been problematic, considering that it's caused me to kinda abandon two other projects in the past, so I've decided to share some tips that I've either come up with
One of the most useful things I've noticed is that it's important to pace yourself - even if you don't want to. This means that you shouldn't try to work more than 4-6 hours on your project per day. Of course, this is coming from the perspective of someone who has to go to school regularly, so perhaps 6-8 would be a more appropriate number for someone who otherwise has no other preoccupations.
The feeling of "I want to work on this project but I can't" in my own experience helps to keep the enjoyment of working on it fresh and lively in my own mind, which means I'm less likely to experience burnout.
Another thing that helps more than I would have expected is keeping an hour count. I use the Godot editor on Steam, which automatically records your hours spent "playing" any particular application and by now I have about 90 hours on record. This helps just for the sake of a number ticking up being somewhat satisfying. Maybe this won't work for you, but it's worth a go.
A pretty useful tip that I use a lot is that if I discover a bug or something that I really don't want to do, I schedule it for either tomorrow or the day after. The most important thing is that I do it then, procrastinating sets a bad precedent for the future. This can be difficult, but it's very useful. If you can suppress thoughts like "ugh I don't want to do this" or "grr this is going to be so much trouble" in lieu of thoughts like "I can make this bit blue" or "where can I add dithering", it helps a lot.
Something that helps quite a bit is making a post on your devblog - provided you have one. If you don't have one, make one and post it to /r/devblogs or something similar. There's another whole post to be made to talk about devblogs and how they're helpful, but just trust me, seeing the "All time views" number tick up slowly is tremendously satisfying.
This is something that I've seen is commonly suggested but somewhat underrated. If you're stuck on something, shut your eyes for a few moments and picture it in your mind in as much excruciating detail as you can. Besides the beneficial side effects of exercising your imagination, this helps you with design, as well as allowing you to recognize the potential of what your game could be if you do everything exactly right.
One last thing that is tremendously useful; if you're not feeling motivated, think of one very small thing that you can do to your game. Bonus points if its very menial or repetitive and doesn't require creative effort, because while interacting with your game in any way you might start being able to think of ways to tackle other problems, whether they're how to recreate something graphically or how to tackle a tricky bug.
Even if you plan on working for 5 minutes, you will often work for much longer once you start. Sometimes the hardest part of something is to start it, and then the rest becomes quite enjoyable.
Anyway, that concludes my list of (hopefully) helpful tips, and if you have done, thanks for reading!