Not entirely sure. I think market developments will make up for many of the job losses by automation, much in the same way they have during previous economic transformations (Industrialisation, Free Trade etc...). However, there may need to be some targeted government spending in the areas where it will strike first. However, I'm not of the opinion that this should necessarily be funded by a 'robot tax', which could drastically slow the pace of automation and endanger economic competitiveness. But you could make the tax system more progressive in general, to capture some of that excess wealth and redistribute to displaced workers and those still in work, or to prime into new industries that have the potential to provide more sustainable jobs. That said, I'm not on board with the idea of an unconditional basic income, because that would be far too costly and could breed a very shoddy work ethic. But there should be some targeted tax credits to ease the transition, which I don't think will be as drastic and sudden as some make it out to be.
"We've ended the war on beautiful, clean coal and it’s just been announced that a second, brand-new coal mine, where they're going to take out clean coal - meaning, they’re taking out coal. They’re going to clean it - is opening in the state of Pennsylvania, the second one." -Donald J. Trump circa August 2017
UBI pretty much, though even that isn't a true solution. Automation is the death of capitalism though, sure enough.
New jobs will be created (mostly in the IT/engineering sectors) but not nearly enough. What separates this event from other industrialization events in human history is the population boom that's accompanying it. Barring some near-extinction events the global population has been relatively stable until the 20th century. Globalism also compounds the issue. In 19th century Britain British workers only had to compete with other British for work.
We're projected to have around 16 BILLION people on the planet within decades. We aren't going to need 16 billion engineers and programmers, though. Hell we won't even need a billion- the more advanced technology gets the less man-hours you need for any project.
Population will completely outstrip labor and then we'll be ****ed.
"The Daemon lied with every breath. It could not help itself but to deceive and dismay, to riddle and ruin. The more we conversed, the closer I drew to one singularly ineluctable fact: I would gain no wisdom here."