How did the conflict with the Soviet Union affect the United States foreign policy during 1945-1990?
The conflict with the Soviet Union (the Cold War) completely dominated the United States’ foreign policy during the time period that you mention. The Cold War conflict influenced every aspect of American foreign policy. Let us look at two main ways in which this was true.
First, the need to compete with the Soviet Union made it so that American policymakers had to care about places that would have been irrelevant had it not been for the Cold War. The greatest examples of this are Korea and Vietnam. If we had not been competing with the Soviets, it is unlikely that we would have cared enough to intervene in civil wars in these two distant countries. The same is true of what happened when the Soviets invaded Afghanistan. We would not have aided Afghan rebels against invaders if we had not felt the need to contain communism everywhere in the world. Thus, the conflict with the Soviet Union led to the policy of containment which made every part of the world strategically important to the United States.
Second, the conflict with the Soviets also caused the US to support anti-communist governments even if they were otherwise abhorrent to our ideas of human rights. The US supported dictatorships and other undemocratic governments as long as they were anti-communist. One example of this was our support for the apartheid regime in South Africa. We supported this explicitly racist regime because it was anti-communist and it was strategically important for its location and resources.
In these ways, the conflict with the Soviet Union during the Cold War dominated the choices that the US made in foreign policy.