2 World Wars turned tide for US$. In wars, US marched in quite late & came
out relatively unharmed.
With resources still intact, it became supplier of weapons, goods as well as a lender for other countries.
As all buying & borrowing countries made payments in gold, it was raining golden for US. By time war ended US held most of world’s gold, making it impossible for other countries to make
further trade payments in gold!
Central banks maintaining fixed ex rates dollars then took place of Gold in countries’ reserves. Countries had to store these dollars somewhere, so they started buying US Treasury bonds, which would then become a safe haven.