Here's an optimistic scenario:
The world population reaches a climax and starts dropping, then dropping faster and faster. The medical system becomes overburdened and once beyond a certain age you receive only basic medical care. Any expensive diseases and you die, simple. At the same time the cheap energy sources start to dry up: oil, coal, natural gas, uranium. Green energy is found not to work. Thorium however is in plentiful supply and it powers thorium reactors that keep the electricity grid functional for a long, long time. But humanity discovers that the infrastructure for an entirely electricity-driven economy is big and burdensome, and gradually begins to de-industrialise: motorcars become the privilege of the rich; commercial air travel disappears. Ships appear with sails to supplement their electric motors, and so on.
As the population declines the de-industrialisation results in a return to the land: growing food and raising lifestock increasingly become the only viable occupations for most people as factories shrink and the whole administrative apparatus shrinks with them. Cities contract into towns, towns into villages. Finally, once the thorium runs out, the human race reverts almost completely to a pre-industrial state, with some - but not much - technology and industry kept up by the wealthy few. Things like pollution, climate change, world wars and the like recede into history and humanity carries on as it had done for thousands of years previously. And they lived more-or-less contentedly enough ever after. The End.