Since the cold war, deterrence has been a fundamental principle underpinning peace between global superpowers. The idea is that if two sides have nuclear weapons, the consequences of actually using them mean the button never gets pressed.
But the strategy goes beyond the countries which own the weapons. In practice, for instance, most of Europe relies on the US for a nuclear “umbrella” of deterrence. And any country with nuclear weapons can offer guarantees of peace to others.
This is what happened in 1994 when Russia, the UK and the US signed the Budapest memorandum in which Ukraine renounced its nuclear weapons from the Soviet era in exchange for a promise to “respect the independence and sovereignty and the existing borders of Ukraine”. This was widely seen as a good idea for Ukraine and the world, reducing the risk of a nuclear accident.