Those who are lose the work can and will find something else
This has been true in the past, but now automation is improving faster than people can retrain and the economy can expand.
The most common job in the USA at present? Truck driver. (well, maybe not, but still, 2.8M truck drivers - 1.5% of the entire working age population in the USA, earning an average of $51,000 apiece)
Imagine how that one's going to go down when automated trucks are viable. Haulage firms will push HARD to get them approved to run on the road - they're already running them on private land (like in the Alberta tar sands, where the robot trucks are safer and require less maintenance and burn 25% less fuel, aside from working all day and all night and saving the company millions in wages).
Almost overnight, unemployment will bump another 1.5% in the USA, and all that money that was going into the economy via truck driver's wages will initially go into the pockets of very rich people before prices adjust.
What are the truck drivers going to do instead? Their life of sitting in a cab knowing the best route and which diners have the best cheese-steak sandwiches isn't going to prepare them for a life in many other professions, definitely not any that are paid as well as $51,000 ; they're certainly not going to get jobs building robot trucks (by definition - if the number of people you're employing to make a more complex and expensive machine is anywhere close to the number of people the machine replaces, then it's not economically viable - so even if someone invents an edumacatatron to fill their heads with robotics engineering, ain't gonna happen).
They won't even get jobs as greeters in WalMart because those jobs are so hotly contested by old folks.
AirBNB has more rooms on offer than Hilton. Hilton employs 152,000 people, AirBNB employs 800.
The trucking industry will likely in the next decade go from having 2.8M drivers in the USA, to zero, and maybe 100,000 or so skilled robot repair mechanics.
Amazon will go from using people as robots in it's warehouses, to just using robots.
Even if people eventually benefit from all this, there are going to be some dark times.