How did the policy of containment shape America's response to the invasion of South Korea?
The policy of containment affected the US response in two ways.
First, the policy led the US to go to war to repel the invasion. The policy of containment meant that the US could not let communism spread into South Korea. Therefore, the US went to war to prevent that spread.
Second, the policy helped influence President Truman and other high officials against broadening the war. Some, like General MacArthur, wanted a fight with China to destroy communism there. But attacking countries that were already communist was contrary to the idea of containment. This is one reason why the war did not spread and why the US was content to return to the status quo that had prevailed before the invasion.