The US and Soviet Union attempted to limit the possibility of global nuclear destruction by agreeing to treaties.
A perfect example of this would be the Cuban Missile Crisis. After finding Soviet missiles located in Cuba, the US was considered invading/attacking Cuba. However, president John F. Kennedy and Nikkita Khruschev were able to find a peaceful solution after thirteen tense days of negotiations. This resulted in the removal of Soviet missiles in Cuba and the removal of US missiles in Turkey.
Other treaties, like the Strategic Arms Limitation Treaty (SALT), also helped in reducing the possiblity of an all out nuclear war between the US and Soviet Union.