Automation has already been happening in many industries, in case you have not noticed, and that did not result in lost job opportunities on the whole of the economy. Agriculture is also largely mechanized all around the world and you have only a very little portion of the population (5% or so) in developed countries to produce far enough for everyone.
Most jobs in developed countries are service related. These jobs will not disappear even if you automate the production part of the economy.