When the tech can do the function of the worker, and do it more economically, the worker will be replaced. This was one of the results of the industrial revolution.
And if the worker is rational and has a good work ethic, he’ll understand and accept the fact that he has to keep improving himself as a worker to make it rational to hire him.
Unfortunately, that kind of thinking is being killed to make way for the “I’m entitled to it and you have to provide it” mentality.