The steps taken at the end of WWII to prevent a future World War were largely inspired by the Allies' failure to create lasting peace at the end of WWI. At the end of WWI, the United States pushed for less harsh sanctions on Germany, but France and England were insistent on stripping Germany of its power and demanding Germany accept full fault for the war and provide England and France with financial compensation for the cost of the war. Essentially, this is an example of someone winning a fight and then forcing the other side to accept an unjust punishment.
Initially, the United States was able to loan Germany money to help make payments to France, but after the stock market crashed in 1929 (beginning the Great Depression), the US was no longer able to provide Germany with financial assistance. This led to a complete economic breakdown in Germany with astronomical inflation and widespread panic and poverty- and it provided Adolf Hitler with an opportune moment to gain power, and present the Jews as the scapegoats, or "wealthy few" who benefitted from the market crash, while the real Germans suffered.
At the end of WWII, the US and the USSR vied for control over the Axis Powers former territories. The United States introduced plans like the Marshall Plan and Truman Doctrine to help aid Europe in the aftermath of WWII and prevent future conflicts. The Marshall Plan provided direct aid to Western Europe and helped rebuild infrastructure damaged during the war, and the Truman Doctrine provided military aid to countries threatened by Communism (such as Greece and Turkey). As part of Germany and Japan's surrender, their militaries were disarmed. The US military established major bases in Japan and Germany that are still operational today, and control of Germany was divided between the US and USSR, carving the country into East and West Germany.
These efforts at preventing future World Wars helped repair US relations with Germany and Japan, but it heightened tension between the US and USSR, even though these countries were allies during WWII. The US wanted to promote democratic governments throughout the world, while the USSR worked to promote Communist governments throughout the world. This struggle led to the Cold War, and multiple proxy wars over the rise of Communism throughout the world (such as the Korean War, Cuban Missile Crisis, and Vietnam War).