In order to answer this question, you first have to figure out how you would define “effective.” There is no one correct definition of this but the definition will do much to determine your answer.
For example, you might say that for America’s foreign policy to have been effective, it would have had to roll back communism. If that is how you define effectiveness, US foreign policy clearly was not effective. The US did not manage to take any country that was communist and make it become democratic/capitalist before 1989.
Conversely, you might say that an effective foreign policy was one that kept the communists from making any inroads in areas of the world that were strategically important. In this case, you would have to say that American foreign policy was effective. None of America’s important allies became communist during this time.
Finally, you might say that effective foreign policy would have prevented the expansion of communism. This was, after all, the idea of containment. If that is your definition, you could say that American foreign policy was somewhat effective. American policy did not completely prevent communist expansion. Countries like Cuba and South Korea became communist during the period that you mention. On the other hand, American policy did prevent communist expansion in the most strategically important areas of the world.
Thus, we can see that the answer to this question depends greatly on how you define an effective foreign policy.