Comment by Shocka1
I have friends in commercial sheet metal/plumbing/electrical, and the work is endless right now in my area in the Midwest. My immediate goal would be to get on a journeyman program making a fraction of what I make now, and then onwards and upwards from there as I know the more skilled people in these jobs are making top tier money in my area. When I was in college I worked part-time in residential, so it seems logical that I would gravitate in this direction, especially with the supply of work.
At the same time I'd be applying to senior software engineering positions geared towards anything energy/nuclear and possibly datacenter tech/engineering positions as well, but I would be extremely picky. Since everyone is so obsessed with AI/productivity, the electrical grid is going to be more stressed than ever. I'd target positions with no H1B competition, cleared positions and whatnot - this isn't a crack on H1B, but I would imagine there is higher probability in getting interviews without them in the picture. BUT I'm at the whim of hiring managers and whiteboards at that point, which isn't ideal, hence the trades route mentioned first.
I love software so much and have spent the majority of my life doing it, spent all that time getting a CS Master degree and whatnot. It would be a sad day for me, but you do what you have to do. I have a family as well, so not as much mobility and time to burn as a person without.
I think this plan is specific to my situation, but I hope it helps getting a few ideas kicking around in your mind. It is definitely a stressful thing if you think about it too deeply, but I try to distance myself from that mental mode and focus more on what I would have to do if that time comes.