I've tried a few methods and here's how I've sort of managed it. The easiest part to address is keeping myself interested into it. Of course, I have several ideas but I make sure to write down only the most important aspects I'll need for later (a general overview, barebones character descriptions). My current project: SUMMON! is an example of this. Since starting development in 2017, I've played around with other ideas and I use that time as a personal break. But I keep myself centered on my current project since I have an overarching goal with it: Demonstrate character design and practice multiple art fundamentals. Plus, I've worked on it for so long, I want to see it to the end. I work in batches of time, say 2-3 hours straight, 15 minute rest, 2-3 hours straight.
Fuel is critical in everything. A good amount of water, a little sugar (dark chocolate and hard candy) to keep me awake and a solid playlist varying genres like Jazz/Bossa Nova/Chillhop, to songs associated with a project. Admittedly, some audio dramas/ASMR/Roleplays have helped as well. Throw in songs you can just vibe to or just have fun with to make the process more enjoyable. Plus, during my breaks, stretch the whole body and (physically) step away from the work to allow yourself to reset and stay centered. Top it all of with the promise to draw/write/create everyday. No matter how small or large, no matter if it's published or personal. Even enjoying art counts! A little art everyday.
It may not work for everyone, but I'm partial to the old-school "push on, even if it's tough" sort of mentality. "Welcome to the Mountain Top" sort of thinking. It's all self-accountability. I set this goal, I want to see it to the end. I will see it to the end no matter what. If it's tough, I'll persevere. My ambitions are greater than my adversities. Effective blocking of time and time-conscious planning are key for me. My current project's production is clearly outlined and I plan it out to not take too much time.
TL;DR: It's all self-accountability, self-discipline and a healthy amount of obsession. In the simplest of terms, my key is the phrase "No Matter What" in regards to creating and seeing a goal to a successful end.