Yes, the United States did try to control the spread of communism by the Soviet Union. This policy was known as the containment policy, which was first proposed by George Kennan, a US diplomat, in 1947. The containment policy aimed to prevent the expansion of Soviet-style communism to other countries by using a combination of political, economic, and military means.
One of the key ways that the United States tried to contain the spread of communism was through the Truman Doctrine, which provided economic and military assistance to countries threatened by communism. This included providing aid to Greece and Turkey in order to help them resist communist rebellion. The United States also provided economic assistance to European countries through the Marshall Plan to help rebuild after World War II, which was intended to prevent the spread of communism by addressing the underlying economic conditions that made the Soviet Union's ideology appear attractive.
Another way the United States tried to contain the spread of communism was through military means, such as the Korean War and the Vietnam War. The United States intervened in these conflicts in order to prevent the spread of communism in the region.
Finally, the United States also used diplomatic and political means to contain the spread of communism, such as forming alliances and alliances with other countries, such as NATO, and promoting democracy and human rights around the world.
The containment policy had a mix of successes and failures, it succeeded in preventing the spread of communism to Western Europe, but it did not succeed in preventing the spread of communism in Asia and Africa.