The Iranian coup d'état was literally about allied control of oil to secure control of global flow of oil and energy related wealth.
Security and being rich are part and parcel of the same coin.
> when it wasted many trillions of dollars over 20 years in trying to turn Afghanistan into a liberal democracy.
Or, alternatively, recirculated trillions of US taxpayer dollars into US weapons, US mercanaries, US personnel, and fed pork barrels where directed by US lobbyists.
> Security and being rich are part and parcel of the same coin.
No the two things are quite different. There are many rich countries (Singapore, Denmark, Taiwain, etc.) that don't have extensive security operations around the world. The U.S. uses its wealth for ideological reasons, not to become richer. This is something that people with a third-world mindset have the hardest time understanding about the U.S.
Yes, the US was involved in the coup in Iran, but again not as part of some plan to enrich the US. (They didn't want the Communists in control in Tehran and they didn't want Soviet warships and Soviet shipping in general to be able to operate from Iranian ports.)
Since the world is complicated and people are creative and opportunistic about how they try to make money, certain American individuals and certain small conspiracies of Americans probably tried to make money off of the US's interventions in other countries, but the US government as a whole basically never has -- at least not in the last 100 years.
While the US economy was dependent on oil from the Persian Gulf (approximately from 1957 to 2020) it used military force and pressure on governments to ensure American companies could buy Persian Gulf oil, but those American companies always paid the going price for the oil: Washington never tried to arrange so that any American interest got oil from overseas for free or for less than the fair price for the oil.
So I still haven't seen any example in this thread of Washington's extracting any wealth from the rest of the world other than through free trade, i.e., trade in which the non-American half of the trade entered into the trade voluntarily. (And again the US economy doesn't even need to engage in any free trade with the rest of the world for the US to be the richest country.)