Yes they were effective in containing the communism policies from taking roots within the U.S and the western world at large.
To start with, the U.S formed the HUAC in 1938, which become effective and active in dismantling it's mandates in 1950. It was tasked with investigating subversive individuals and organizations thus hunting communists who were associated with the Soviet Union. Eventually responded over their activities and successfully prevented them from introducing policies of communism in the United States.
Similarly, the McCarthy policy was mostly used in the U.S. For instance politicians like senators used the propaganda against the State of Department Agencies and senior government officials that they were closely and secretly introducing the communism in the U.S. It was perceived as an awkward thing to be associated with the Communist Societies hence it wasn't welcomed in the U.S society at all.
Finally after the U.S realized that there were some individuals and organizations operating within the U.S territory that were responsible for spying some crucial information to the Soviet Union, it started eliminating them slowly. This was considered as a threat to the U.S s the Soviet Union started manufacturing of atomic bombs which were only made by U.S.