It will put some people out of work. It will create in more jobs in total.
The problem is, your answer sounds a lot like telling laid off coal miners to "Learn to code, Bruh!" meme.
They may or may not be able to find other jobs. Most middle tier jobs are going to be gone. Also taken by AI. You travel agents, claims adjusters, accountants, executive assistants, paralegals, etc. All that's going to be gone or you're going to need a LOT fewer of them and the remaining jobs will probably just be take by H1B's.
Even for software engineers, you are going to need a LOT fewer and the quals are going to climb higher and higher. All the middling programming jobs; Web script hackers, QA testers, WordPress developers, etc, Buh Bye. I hate to sound elitist, I know that isn't the fad now days, but not everyone is capable of becoming a top tier software architect. Even amoungst current working programmers, maybe 15% could be trusted to design a complex system. An ex-travel agent has a low probability of just taking a 6-month coding camp and coming out a a software architect.
All those middling jobs will be the first to go. Eventually even the higher end jobs will either be taken by AI or really cheap H1B's. They are even trying to automate fast food workers. If a burger flipper's job isn't safe, who's would be?
Maytag robot repairman? I don't think you will need 1/10th as many of those as you had human factory workers, so what do you do with the rest of them? And I don't see why you couldn't just have specialized robots that repair robots. Especially if the factory robots are specifically design to be repaired by robots.
I won't even get into agism which is rampant. At least in the tech world, if you are 40+ and get laid off, now days you're going to have a tough time getting another job. If you are 50+? There is a good chance your career is over. Hope you socked away those stock options from the boom times. Between AI and H1B's you better like delivering Uber Eats. Until the self-driving robotic delivery drivers take over too.
I don't know what the answer is, but I foresee a level of social displacement in the coming decades like we haven't see in a long time. I see no way to stop it, but everyone should be preparing. I think there is going to be a large surplus of unneeded of human material. What you do with that I don't know.
Soylent Green?