Jposeph Tainter offered no prophylactyics...
...when he wrote 'The Collapse of Complex Societies'
( https://www.amazon.co.uk/Collapse-Complex-Societies-Studies-Archaeology/dp/052138673X ) .
Today we would understand this as a n understanding of how a complex non linear system with feedback evolves.
The cycle is broadly
1/. New ecological/technical/whatever niche is discovered that allows population growth.
2/. New population is initially involved directly in its exploitation to produce wealth.
3/. As time goes by more and more bureaucracy evolves to deal with the distribution of said wealth.
4/. Eventually the society is all bureaucracy and no productivity.
5/. Finally, a society in which all the bureaucrats and large sectors of the population have been removed, allows a better standard of living for the survivors, and a steady state at a much lower population density and without the 'bureaucratic civilisation', evolves.
I.e wealth breeds bureaucratic complexity,and bureaucratic complexity in the end stifles production of wealth, usually triggered by running into any one of a million potential 'limits to growth'. A vicious positive feedback process then returns society to a new level of barbarism.
E.g. The Maya who built Chichen Itza did not vanish. They will serve you a beer and tortillas happily. It was the priests who sacrificed them to make the rains come, and the bureaucrats that took food from the peons to give to the priest class, that have vanished. [Presumably the rains didn't come, so they sacrificed the priests].
Today's society is built on just two things: machines and artificial energy. And we have plucked much of the low hanging fruit.
More and more complexity for less and less actual advantage. And finally the barbarians at the gate come in and smash everything, because they dont need it and they don't understand it, and you and your I-phone are just another piece of archaeology to be puzzled over 1000 years from now.
"WE think they had something to do with the 'windmill cult' whereby pointless three bladed devices were erected everywhere to stop the world getting hotter, or so the priests said, in some sort of religious ritual, designed that allowed these prayer devices to be operated on windy days"
"Of course the enlightened people came in and smashed the windmills, and killed all the priests, and the world got colder instead, but that's religions for you in the dark ages of the 21st century"
(excerpt from 'the archaeology of the 21st century: "Do you want fries with that" by Adolf Mohammed el Schloctermeier, may God bless Adolf, his Prophet and martyr to the cause )