After experiencing the immense loss of over 400,000 lives in World War II, the United States chose to get involved in the military conflict in Korea primarily due to its containment policy against the spread of communism. Following the end of World War II, Korea was divided into two zones, with the North under Soviet influence and the South leaning towards the US. In June 1950, North Korea invaded the South, prompting the US to intervene to prevent the spread of communism. The US saw this as a crucial opportunity to demonstrate its commitment to containing the Soviet Union and its communist allies. Furthermore, the fear of a "domino effect" in Asia, where one country falling to communism could lead to others following suit, also drove the American involvement in the Korean War. This strategic concern and ideological motive prompted the US to enter the conflict, leading to a three-year-long military engagement that finally ended in an armistice in 1953.
I hope this helped!
~~~Harsha~~~