There are a multiple ways in which Brazil, which had the similar economic potential early in the mid-19th century during the imperial period and it was a major rising power both politically and economically and enjoyed a good deal of prestige and prosperity as Australia, US and Canada, did could have infinitely become better off than the mess it has become in the past 100-plus years. I find some the best ways are:

1. Avoid the Coup d'etat of 1889 that remove Pedro II and the Brazilian Monarchy, so keeping the Emperor in power might be a good alternate timeline to look at - if Pedro II son prince alfonso didn't die from epilepsy, or if Princess Isabel is a more vigorous heir? Brazil develops much like Spain, Portugal, US, Canada, Australia or Italy.

2. also make Napoleon fail to capture Portugal which in otl had caused the monarch and the royal family to flee there, With Napoleon Invasion of Portugal Fails which results in Monarch and the Royal Family staying in Portugal and the Portuguese-Brazillian Dual monarchy in 1825 doesn't fall apart in the war of the brothers, so Dom Pedro isn't ousted and Brazil would turn into Commonwealth-Like Independent Nation (similar to Australia and Canada), where the two countries have close ties and the king staying in power.

3. have Getúlio Vargas never resigned as a President in 1945 and his reign continues until his death, assuming he survives coup attempts (OTL he resigned because of political liberalization after WW2), Brazil develops much like Spain and Portugal.

4. Avoid the 1964 Brazilian coup d'état that cause the Brazilian Military Dictatorship which plunged Brazil into Poverty and Misery, so without 1964 coup Joao Goulart would continue to finish his term in 1965 and succeeded by Juscelino Kubitschek who lead Brazil's 5-years during his first term president, he would have continued his 5 year plan thus transforming brazil into a economic powerhouse.

5. have the Dutch succeed in their invasions of Brazil in 1647-54 and follow up on that success - Brazil joins the Dutch Empire, and lots of Dutch, German, English and other Northern European settlers move to Brazil in much the similar manner as Canada or Australia (and the country develops accordingly) (NO OFFENSE)

All of these scenarios, at best, would forestall Brazilian Military Dictatorship and all its deleterious effects, and Brazil would thus be a developed country in the same league as Western/Northern/Southern Europe, North America, Japan, and Australia. Which of these scenarios sounds better in terms of turning Brazil into a First World country and 5th Largest Economy?
 
Family planning without any religious interference or dogma, so family size will be lower meaning more disposable income, for things you want rather than need.
 
The royal family going to Brazil was actually good for the country, since they took the portuguese elites with them, not only nobles but also a lot of capable people, and many of those stayed on.

An earlier abolition of slavery might have been good for Brazil. According to wiki:
"Brazil was the last country in the Western world to abolish slavery. By the time it was abolished after years of campaigning by Emperor Pedro II, in 1888, an estimated four million slaves had been imported from Africa to Brazil, 40% of the total number of slaves brought to the Americas"
Slavery is not a good fundation to build a country on, and Brazil still pays a social price for having been built upon it.
 
Top