The Japanese started WWII by attacking Pearl Harbor, in time of peace, without a declaration of war. They sank the Pacific Fleet battle line, which gave them naval supremacy thruout the Pacific, at least by the thinking of 1942. They inflicted several more humiliating defeats upon us and upon the British. They treated our prisoners of war like dirt, many of them died in Japanese captivity.
The Japanese fought hard. Guadalcanal, Saipan, Okinawa, Io Jima, Tarawa. Based upon bitter experience gained on Okinawa and Saipan, we figured invasion of the Home Islands would cost us a million casualties, and the Japanese far more. By 1945 US submarines had blockaded Japan, nothing big enough to be worth a torpedo was getting in or out of the Home Islands. The Air Force had total air superiority, and were fire bombing every city in Japan. Even at this low point, with their backs to the wall, the Japanese refused to negotiate.
Offered a chance to end the war, Truman took it. And it worked. The first nuke on Hiroshima shook 'em up, but not enough to bring them to their senses. The second nuke on Nagasaki finally did the trick. The bitter end generals were pushed out of government, and some rational men took over and ended the war.