Well that's a catch 22, chicken and egg problem.
Few things that come to mind... Obviously have some cash aside for this type of "sabbatical".
Another possibility is to get someone you used to work for "invest" in the idea, as a sponsorship of some kind, in which they have some skin in. This can work because presumably you're solving a problem related to your career path.
Another option is some seed investment from an accelerator of some kind, but your chances are really low unless you promise them a unicorn shitting gold on a platter.
Finally, family can help for this sort of thing, but again they have to understand that it's throwing money down the pit 90% of the time.
You can also try to take on a part-time contract to sustain yourself while helping out someone else. Like a 3 day week affair, where you work the remaining 3 days on your project and take a day off. Worst case is take a mind-numbing job which doesn't get you tired mentally, and focus your mental efforts at night on your side projects.
Another final idea that pops to mind is the Patreons and gofundme type options... They can work if you're pretty on video and can sell your idea to the common people. Most of us are too shy to even fathom doing this... I would have impostor syndrome personally, then there is the constant answering to people pain...
A lot of us are in this boat, so don't feel like you're in it alone or crazy doing so. The reality I suspect is 90% of us go back to work to fund their night/garage project; until we can finally live in a utopia where humanity could actually focus on advancing itself rather than spinning a wheel in a cage.