The US implemented the Lend Lease policy before joining WWII, which put many European powers in debt to the US. The majority of WWII western front was fought in European and industrial complexes were the main target of attack for both sides. Most of these factories were commercial and transferred to war production for the war effort. When the war ended, factories and infrastructure were destroyed, leaving the US as the sole producer of manufactured and produce goods left. Europe owed the US money for Lend Lease and now was importing US made goods to supplement their lacking production. This lead to most of the world economy running through the US, this leading to the post war boom.
Edit: read Pmaj28's comment below me.
There are more factors involved in this question than could ever be covered. For this question and the wide breadth it covers, I'll basically just do a brief survey of the US' rise at a more geopolitical level. To bring some of the longue durée's flair in, I would assert that geography is undoubtedly the single greatest asset that the US has had.
The US' best allies are the Atlantic and Pacific Oceans. They not only make any assault that much more difficult, but they buffered the nascent US (and its interests in the hemisphere) from all the world's imperial powers. The US has been at war with both Mexico and what is today Canada, but they have never posed any kind of existential threat to the US. Of course, for most of the US' history they have had friendly relations, and the US-Canadian border is both the longest border by distance between two countries and the longest unmilitarized border in history. Meanwhile, Europe was embroiled in near perpetual unrest and war. The US' large size and relatively sparse population also means a much greater amount of resources per person. This includes oil, metals, and one of the most fertile areas in the world.
Of course, the US didn't start off by spanning the continent. It expanded through a combination of diplomacy, conquest, and I would argue, outright luck. The territory doubled in size from the original Thirteen Colonies with the Treaty of Paris (1783) that concluded the Revolutionary War. Jefferson quickly purchased the Louisiana territory from Napoleon in 1803 - an offer Napoleon made after the French colony of Haiti declared independence and successfully defended against French forces. He simply wanted to wash his hands of the West. The size of the US had doubled again. Then President Polk launched an invasion against Mexico (1846-1848) which led to the annexation of Alto California and New Mexico.
The Spanish-American War in 1898 is what propelled the US to world power status. Though the Spanish Empire was a husk of its former self, it was still considered a major imperial and naval power. The US victory also meant the acquisition of Cuba, Puerto Rico, the Philippines, and Guam. Coupled with the annexation of Hawaii that same year, the US now had a platform for projecting its influence and power even further - particularly in the Pacific.
It is also important to note that throughout the US' history, it has engaged in various interventions that have furthered its power (though many came with corresponding blowback). Since early in its history, the US had acquired near total hegemony in the Western Hemisphere, as exemplified by the Monroe Doctrine. Here's a list of those, among other conflicts. For anyone interested in more recent such interventions done at the behest of the US' economic interests, I would recommend Overthrow by Stephen Kinzer, which spans from the acquisition of Hawaii to the 2003 invasion of Iraq.
Then of course there are the World Wars. If the Spanish-American War introduced the US as a global power, participation in WWI solidified it. While industrial centers remained largely intact, European nations had fully mobilized their economies and manpower to make war. This meant that ultimately the victors were not left much better off than the losers, having had their manpower and resources depleted.
WWII, however, was the ultimate gamechanger. Cities across Europe and Asia had been turned to rubble, while rapid mobilization on the US homefront made the US the "Arsenal of Democracy." The US invested heavily in these nations via the Marshall plan, and the world currency changed from the British pound to the US dollar. The US had near total economic hegemony. Before WWII's mobilization, the US didn't have much of a standing military force. Though its sizable and advanced military was rivaled by the Soviet Union's, the US had effectively established bases and other military footholds around the world. Its naval power became and remains utterly unmatched. The subsequent Cold War further pushed the world into two camps - that which was politically aligned with the US (the "First World") and that which wasn't (the less industrially and economically developed "Second World.") Despite being barely 170 years old, the US had become the world's first superpower with the ability to project its power anywhere on the globe. Also in response to the Cold War and the prevailing Domino Theory, the US maintained its standing military force, which for better or worse, remains today the largest (in every way except the number of soldiers) and most advanced in the world.