There's several things I want to address as part of my answer.
Job Creation
The fact of the matter is that automation makes more jobs than it takes away. As automation removes the lower end jobs, or functions of jobs, it releases those people to take on different types of work, which gives them the opportunity to do work that wasn't previously done due to lack of funding, lack of labor, lack of interest, or a hundred other things. As a software developer, there's lots of things that become "technical debt" due to the inability for us to get to it right away, if ever.
https://www.washingtonpost.com/technology/2018/09/18/machines-will-create-million-more-jobs-than-they-displace-by-world-economic-forum-says/?noredirect=on
Retraining and Increase of Wages
I've been in job markets where there are more people doing the work, or trying to do the work, than there is work. I got fed up with the lack of work, low wages, and employers replacing me anytime they decided to, whether it's because I made a mistake, office politics, "the economy", or whatever. I learned a new topic and got into another sector, increasing my wages and my ability to stay in a job.
A stick welder of 40 years might not be able to become a doctor through retraining, but they can learn MIG and TIG welding, which can get them a better job at a higher rate. A previous MIG/TIG welder at an industrial job might decide to start their own custom bike business, due to running out of work at their job. A bike builder might decide to start designing bikes in CAD, instead of doing the manual work. A CAD worker for a bike maker might decide to design farming machinery. The farm machinery CAD operator might decide to get an actual 4 year engineering degree so they can tell their now former colleagues how to build the new version of the harvester. An engineer might decide to quit killing their brain with equations and be a manager. A lower manager might become a CxO. A CxO might decide to start a brand new business that ends up hiring a bunch of new people to create a new product or service in an industry that is being under served by the existing companies.
It's a long road involving a bunch of people, and it still doesn't end in a medical doctor, but it can easily improve each persons pay rate by 10% or more. That's far more than most of the raises I've ever gotten.
BTW, I start my "ladder climb" example with a stick welder, but I know those people aren't the very bottom of the ladder. (I didn't intend to start at the very bottom, either.) They might not be the smartest people, but to be good at that job takes a lot of experience and hard work. Even though I'm a software developer, I've welded a fair amount. It's hard work besides the physical labor involved. Knowing the correct amperage, type of metals, type of sticks to use, the correct procedures to get a good weld, and more is not something that can be learned in a short while. I have a lot of respect for good welders.
Speed of Automation
It takes a lot of time to automate most jobs. Even the "simple" ones can take weeks and months. Most of the time, people have a lot of time to be able to replace their jobs. If they can't find a better job inside the company, they should be looking outside the company. If they are surprised by losing their job, they likely weren't paying attention. Even if nothing is ever said, there's still usually indications.
These indications are often when management goes silent or seems to be skittish about certain topics. If they stop talking about "the future", pay raises, bonuses, or maybe start talking about early retirement packages. Even managers usually hate firing people. Not only do they know people need to get paid to stay fed, clothed, housed, etc, but if their whole team is fired, they likely get fired, too.
Even when a place has automation coming in, it takes a long time to get it installed and fully functional. During that time, the company usually needs to stay functional and performing their duties to their customers. Even after all the automation is installed, those machines need maintenance and even a human overseer. If (and when) something goes completely outside of the original machine parameters, a human still needs to come in and correct it, even if it's as simple as removing a jammed bottle from a conveyor belt that fell over at a bad spot.
Some Jobs are Immortal
Even though we have cars, and cars are made using a huge amount of automation, there are still horse carriages. True, there aren't as many as there used to be, but they still exist. These are still made by humans. Until people get completely tired of taking a horse drawn carriage for fun or for their weddings, those carriages will still need to be built. This means that a certain amount of people will always be employed making them. This also goes for the people who maintain the carriages as well as the horses. Sure, you can automate some of that away, but not all of it. The fact is that some jobs will just never go away.
Some jobs will always require humans
A robot can place components on a circuit board faster and more precise than a human, but they can't design it, diagnose it, or fix it. Sure, you can throw the board away and simply replace it, but that's wasteful and a human is needed to recycle the precious metals and hazardous materials in that board.
There's plenty of things that will require human intervention for the foreseeable future. It'll take hundreds or even thousands of years to be able to get to a place where humans don't have to do 90% of the jobs available today, and more than likely, new jobs that we can't conceive of today will exist to replace them.
Just 100 years ago, most of the jobs today didn't exist. Computers were invented in 1937, yet it took almost 40 years for being a computer programmer became a standard position. Before the 1980's, it was relegated to government and University positions. Now there are millions of software developer. Computers replaced a lot of job, yet it also made a bunch of other jobs as well as making people more productive, in general (when they aren't watching cat videos on social media).
Something as "simple" as a secretary went from having to type 100 copies of the same letter through the course of a week; to typing it once, then printing it 100 times in a couple of minutes. Companies used to have lots of secretaries that only replicated documentation for higher level secretaries. Now that can duplication can be done by nearly anyone, simply by going to the copier or telling the printer to make more copies, how to collate it, single or double sided, if it needs staples, binding, or whatever.
Management's Job
Automating really is a good thing, even if people can't see it. You can't explain it to them well enough in 5 minutes to make them understand, and it's not your job anyway. You get told what to work on, just like the people who's jobs you are automating. Whether it's improving their performance, improving their working conditions, or removing the need for their position doesn't really matter to some people, and you can't explain it well enough to these people. Some people, yes, but it's still not your job.
Many people will have a mindset that automation is evil and nothing good can come from it. Nothing anyone can say will likely change their mind, mostly because they don't want to change their minds. Not your fault and not your problem. Unfortunately, you have to treat everyone the same way as you do these people, as in directing them to your manager for their grievances. You are paid to be the automation engineer/tech, not the PR or HR person. Again, that's the managers job. A good manager will put themselves between you and the other employees. Even good ones won't catch everyone, so make sure that you do the rerouting of things anyway. Likely the manager has more experience in talking to these other workers and better know how to handle them than you do. It's still their job, not yours.
I'm sure I had other things to say, but I can't remember them anymore.