I'm still in the typical 9-5 job since I'm way too young to retire (and we don't get paid the crazy money in the UK that software engineers in parts of the US do), but I've been able to settle on what I want and what I don't want so I have the power to walk away.
In the simplest terms, I just need to be at a place working on something I give a fuck about, which pushes me to smaller upstarts. This sometimes incurs a bit of a paycut but I see that as a worthwhile hit to take if I don't feel like I'm selling my soul to people I realise I don't want to work for.
Just gotta avoid the lifestyle creep so a temporary downsize doesn't contribute to mental distress.