The policy of containment was developed by Harry Truman and led the world into the Cold War which lasted until the 1990's. Truman felt that America as a world super power had a duty to protect the "free" peoples of the world. He first put his policy of containment into practice with the Berlin Airlift which enabled the besieged citizens of West Berlin, occupied by the French British, and United States, to fend off a Soviet takeover. Truman and later Presidents also used economic aid to help contain communism. Economic aid to Europe in the form of the Marshall plan enabled Western Europe to quickly rebuild its economy and infrastructure avoiding the economic despair that can open the way for Communist electoral victories. Further alliances such as NATO also kept the states of Western Europe united against communist takeover. While policy of containment were fairly successful in Western Europe, the policy led to hot conflicts in Southeast Asia which cost many lives on both sides and really solved nothing.
Containment was a pretty successful policy. While it didn't stop the spread of communism completely, it certainly protected Western Europe, Japan and many of our allies from what were direct communist threats at the time. Part of this was because of alliances which strengthened our hand, and part of it was because of a very consistent and direct US foreign policy.