The United States dropped atomic bombs on Hiroshima and Nagasaki in August 1945, in an effort to force Japan to surrender. The bombs killed hundreds of thousands of people and caused widespread devastation. The Japanese government finally agreed to surrender on August 15, 1945, after the Soviet Union declared war on Japan.
So, while there were negotiations between the United States and Japan before the atomic bombs were dropped, those negotiations did not fail. It was the dropping of the bombs that ultimately led to Japan's surrender.