Essentially through dropping the atom bomb on Hiroshima and Nagasaki. The Japanese soldiers had been fanatically loyal to the Emperor and fiercely defended the Pacific islands leading to heavy casualties amongst the American forces.
After the atom bomb was used Emperor Hirohito surrendered and Japanese soldiers followed his order to stop fighting.