Too bad we didn't arm the South Koreans better, before we abandoned them in 1949.
The Russians trained and equipped an army in the North, withdrew, and challenged the U.S. to do likewise.The South Koreans and the U.S. State Department wanted the American troops to stay, but the GAROA funds expired on June 20, 1949, and the U.S. Army had no funds to keep the troops there. They were withdrawn.
Most everyone agrees that had the U.S. troops remained, there would have been no war. U.S. troops remained in West Germany and Communist East Germany did not invade. Clearly, the Korean War could have been prevented by an adequate peacetime defense budget.