Why do you think it's "years ago"? It's scarcely a year since USA left Afghanistan ending a 20-year occupation. Trump refused to leave Iraq despite its government unaniously voting for USA to leave:
https://www.washingtonpost.com/world/middle_east/iraq-asks-u...In Yemen, the US-led airstrikes have bombed hospitals, markets, etc. as recently as a couple years ago, leading to the largest humanitarian disaster in the world: https://www.washingtonpost.com/investigations/interactive/20...
In multiple countries across Africa, US-trained officers have led numerous coups: https://theintercept.com/2022/03/09/intercepted-podcast-afri...
Yes, it's true that USA seems to have stopped overthrowing governments in South America (if you don't count the coup in Honduras, or our upcoming invasion of Haiti). But countries across south America remember the decades of overthrowing governments and installing our puppets there. And countries across Africa are seeing it today.
Collectively, the "global south" and the "middle east" doesn't have a great view of the USA. So it's not surprising that many of them are joining BRICS as a way to have some allies against US aggression and hegemony, or at least counter its financial dominance with the dollar, world bank and IMF. It's not unlike the governments of countries that experienced USSR's aggression and hegemony seeking to join NATO, in order to have some allies against USSR, and now against Russia. It's not necessary for all their interests to align, in order for some of them to align. "The enemy of their enemy is their friend", is very much in play here.
But you can go further, beyond governments and politicians (as I like to do) and look at polls of regular people around the world. It's not very favorable to USA. Not just "years ago", but let's just look at the last 20 years. The public in our allied countries in Europe named USA as the greatest threat to world peace:
2002: https://www.pewresearch.org/politics/2003/12/10/anti-america...
2007: https://www.ft.com/content/70046760-27f0-11dc-80da-000b5df10...
Across the rest of the world:
2014: https://nypost.com/2014/01/05/us-is-the-greatest-threat-to-w...
2021: https://www.theguardian.com/world/2021/may/05/us-threat-demo...
2022: https://thewire.in/world/more-indians-hold-us-nato-responsib...
2007: https://www.ft.com/content/70046760-27f0-11dc-80da-000b5df10...