In order to stop the spread of communism the United States did two things, it implemented the Marshall plan and the Truman doctrine. The Truman doctrine (named after president Harry Truman) set a precedent for American assistance to anticommunist regimes throughout the world, no matter how undemocratic. Harry Truman told congress that it must be the policy of the United States to support free people who are resisting attempted subjugation by armed minorities or by outside pressures. The doctrine stated that the US would provide military assistance and economic support to all democratic states.
The Marshal plan was installed to help stabilize European economies by funding them with 17 billion in aid to rebuild war-devastated regions, remove trade barries, modernize industry, and make Europe prosperous again. A main goal from the US through this was to dissuade European countries from adopting communist political ideals. These plans ran for four years respectively and was very successful.