Been going through something similar. I still enjoy technology, though my passions have cooled into what I think of as "useful technologies" as opposed to "toy technologies" (basically - is it useful, or is it just entertaining?). I, too, have been in tech for at least 20 years now. The funny thing is, I remember when I got into the career right out of college how resistant I was to the whole idea. I recall very clearly sitting in my college apartment the week of graduation cursing the fact that I was now facing down a couple of decades of sitting in a cubicle instead of actually living a life. Everyone told me to suck it up and get to work - parents, mentors, media, etc. - so that's what I did.

I think a big part of the reason so many people are miserable - not just in tech, but across every industry - is because we have all been convinced to sell the bulk of our lives to rich people for the sole purpose of making them richer. We spend on average 40 hours a week dedicated to jobs whose sole focus at the end of the day is to make the owners and investors richer. We get a piece of it - some more than others - and we're told to be happy with that as we spend the best parts of our lives not with the families we have built, the communities we have chosen, or in celebration of the life with which we have been granted, but dedicating ourselves to the betterment of a wealthy few. And it's only getting worse. Elon Musk's expectation of having a "hardcore" group of employees willing to work 80 hour weeks just so he can save his $44B mistake is peak malignant narcissism, and there are folks actively praising him for it. Fuck. That.

Find work that is meaningful to you. Not that bullshit "save the world" type of crap that hides exploitation of workers beneath a veil of toxic positivity (effective altruism is, at best, bullshit, at worst it allows these assholes to not only exploit the labor of others, but their sense of good will as well) - I mean true, meaningful work that you and the communities most important to you see direct benefit from. Rather than work for another bloated rich asshole, either work for yourself or find a group of local, like-minded folks and work cooperatively - sharing the duties and sharing the proceeds equally or equitably. If you can't find folks locally and want to stick to tech - the choice I'm currently making until I can be in a position to start something locally - then do the same thing, but with a group of like-minded techs. I am now a full time independent consultant, but I occasionally hop on to projects with friends in the industry in similar positions. We name our prices and often kick a little more to the person handling the coordination with the client, which grants us control of our time and a reasonably steady income. You may be surprised how easy it is to build such a group of people. You say you've been in the industry for ~20 years - my guess is you have developed a pretty strong network. Shake that tree and find your people.

If you've completely lost your passion for tech... well, first, I'm very sorry to hear that. I'm willing to bet if you can take a break from having to rely on it to make all of your income, you may find yourself drawn back into it. Until then, I'd suggest looking around your community and starting a small local business, run as a worker-owned and operated co-op. Get loans or fund it by providing the loans yourself, but no one should have an ownership stake unless they work directly for the company, and everyone working for the company should have an ownership stake and a say in how it's run. Spread the risk among everyone who joins, and also spread the reward when you succeed. Don't build a business, don't be a boss - build a community, become a leader. Unless you were born rich or are willing to commit the majority of your time and life to becoming rich by exploiting other people, you will never be rich yourself. Instead, shoot for thriving in a community where you are well fed, well loved, and well rested. There's no single or simple path to it, but focus on that as an end goal and you'll find the path that works for you.