With both the Eastern and Western fronts shrinking into the original German land and soldiers and resources depleting rapidly Germany was in trouble. Then their leader Adolf Hitler knowing there was no hope committed suicide. The new leader also knowing their was no hope dragged it on for a little bit before ultimately surrendering.
Bombing of Hiroshima
After the US dropped the nukes on Japan the Cold War started. The Cold War wasn't actually a war but just a political tension between the US and the Soviets. The Cold War lasted until the Soviets fell in 1991. The Cold War was also a nuclear arms race as both countries built as many nukes as possible.
Bombing of Nagasaki
The Manhattan Project was the project where American scientists came together to create the first atomic bomb. The US used the bomb to drop on Japan to try and quicken their surrender and show off the newfound power that they possessed to the world.
Japan Surrenders
The United States thought that dropping a nuke on Japan would quicken their surrender. They also thought the only other alternative was a full on invasion of Japan that would lead to a lot of US deaths and possibly more Japanese deaths than the bomb did. The bomb may have also been revenge for Pearl Harbor.
Japan did not surrender after the first nuke so the US just to be 100% sure that Japan would surrender dropped a second one. They did not want the war to drag on because the US solider death count would only go up.
After two nukes were dropped on Japan and the threat of a full on invasion from the US as well as the Soviets joining the war Japan had no choice but to surrender. Having to deal with enemies on both sides and nowhere to go because they are an island surrendering was the only way they would survive as a nation.