It’s actually not about time but about energy levels.
To be able to accomplish this, you setup your life to have maximal energy level balance throughout the day.
For me that meant to unfortunately leave my girlfriend at home almost every evening the past year to get a few hours in almost everyday until I was done.
This also included eating the same food (ready made from Lidl) everyday and just saying no to everything and everyone all the time.
I also recommend that you try to take as little responsibility you can at work and perhaps working from home if possible, where you then use half the day for your own stuff.
One of the few benefits of this lifestyle/endeavour is that you have an income while trying your startup idea.