You can’t prevent the spread of knowledge.
Nuclear technology is waiting under a rock to be discovered. It’s like electricity - eventually we will all understand nuclear power and the associated technologies. In every nation.
Globally we have sought to suppress the spread of this knowledge for “security” reasons. This may satisfy jingoistic impulses, but it’s unclear how the world is safer when knowledge and technology are tiered. I have no reason to believe that the United States is a more capable steward of nuclear technology than Pakistan, India, Russia, Israel, etc. I have assumptions, but those are all based on self-serving prejudices.
I think the spread of nuclear power might make the world a safer, fairer place. I know that sounds insane, but the fact is that nukes teach us important lessons about war. It makes 0 sense to obliterate people and places for disagreeing with you; MAD is a constant assurance that diplomatic engagement is the only real way to resolve problems. MAD removes the purpose and efficacy of war from the equation.
It also creates the potential for anarchic or misguided individuals to have devastating lapses of humanity. The size and scope of war grow every time a new nation gains access to nuclear weaponry, but so too does the shadow of terrorism. We live in an irrational world where people kill themselves and others in protest. A lone suicide gunman can only do so much damage; a lone nuclear terrorist can murder a city and salt the earth for a generation.
The only way forward is to be optimistic and hopeful. At the end of the day, nuclear proliferation can only be delayed. Every country will have nuclear weapons someday. The question is if this will cure the human madness of war by ending war, or ending humans. My advice? Look on the bright side and trust in the brotherhood of man more than the brief, temporary rule of nations. To love the bomb is to love and trust each other.