However, nuclear war between the US & USSR was not prevented by the existence of nuclear weapons. Even ignoring the logical absurdity this would require, the simple fact is that nuclear war nearly happened on many occasions as a result of various misadventures, and it was a matter of pure dumb luck that it didn't. It literally is just an accident of fortune that we didn't have a world-encircling cataclysm. Your and my existence hinges merely on happenstance. Huge amounts of documentation attest to this. The best single-volume account is probably Eric Schlosser's Command and Control.
Nuclear weapons don't prevent war. They reduce the frequency of some types of conventional war, at the cost of making cataclysm absolutely inevitable. They will be used at some point, whether by malign choice or accident. It is only a matter of time.
There are a whole bunch of other questions discussed by military historians which complicate the matter further, arguing (for example) that nuclear weapons increase the number and length of proxy wars. But even that's all a detail in the face of the manifest fact that if nuclear weapons continue to be deployed, we will have a nuclear war one day.
So perhaps we should be working on some less risky peace-building efforts, while there's still time?