The covid-19 pandemic has upended life around the globe. It has brought the world’s economy to a grinding halt; a severe recession will soon follow. But the greatest tragedy — of course — lies on the human side. Covid-19 has infected over 2.5 million people with confirmed cases and led to 182,000 deaths (and counting).

The crisis is exposing serious problems both in the United States and abroad, from the underfunding of national health systems to fragile global supply chains and the unreadiness of international organizations.

As disastrous as covid-19 has been, it may offer an opportunity for addressing these structural problems. Milton Friedman, the Nobel Prize-winning economist who advised Ronald Reagan and Margaret Thatcher, thought “only a crisis … produces real change.”

It’s too soon to tell if the pandemic will produce such change. But this much is certain: Change in politics and society never happens by itself. It’s the result of human will. And it requires leaders who can question their own assumptions and act boldly. Only this sort of leadership will ensure that the losses from the pandemic have not occurred in vain.

The Cuban missile crisis of October 1962 was — in the words of historian Mark White — “the most dangerous confrontation” of all time. At the height of the Cold War, it pitted the United States against the Soviet Union in a perilous standoff over the deployment of nuclear missiles in Cuba. For 13 stormy days, the threat of full-blown nuclear war was omnipresent. The very survival of humanity hung in the balance.

President John F. Kennedy was all too aware of the stakes. But he kept a cool head, resisting the advice of more hawkish advisers, and, along with his Soviet counterpart Premier Nikita Khruschev, pursued diplomacy. The two successfully negotiated an agreement that ended the showdown. The apocalypse had been narrowly averted.

Yet Kennedy was haunted by what might have been. He carried the fear of being the man who ended humankind deep within him. According to his friend, the British Ambassador David Ormsby-Gore, Kennedy “finally realized [after the crisis] that the decision for a nuclear holocaust was his.” But if the decision to unleash hell on earth was indeed his, then so was the decision to seek peace.

Kennedy reached out to Khruschev to de-escalate tensions. In so doing, the president went not only against the orthodoxies of the military establishment, but also against his own past positions. Indeed, in the 1960 election, he had campaigned to the right of Republican Richard Nixon on the Cold War, deeming Khruschev “the enemy,” and later pushing the U.S. into an arms race with the Soviet Union.

But after the Cuban missile crisis, Kennedy changed course. He empathically called for peace: “What kind of peace? … Not a Pax Americana enforced on the world by American weapons of war … not merely peace for Americans but peace for all men and women — not merely peace in our time but peace for all time.”

A major move toward peace came in the summer of 1963, with the signing of the Nuclear Test Ban Treaty between the U.S., the Soviet Union and the United Kingdom. The first arms control agreement of the Cold War era, it outlawed nuclear testing in the atmosphere, space and underwater. Only a year before, few ever thought such a treaty could happen.

But the trauma left by the Cuban missile crisis had been so intense it turned — to borrow an expression from Friedman — “the politically impossible” into the “politically inevitable.”

Yet, making it reality required significant work from Kennedy; the president had to launch a whirlwind national campaign to get the skeptical U.S. Senate to ratify the treaty.

The trauma of the moment had certainly offered the opportunity for change, but it still required Kennedy’s determination and focus to translate that opportunity into reality.

British Prime Minister Alec Douglas-Home called the Test Ban Treaty “the beginning of the end of the Cold War.” This reflected Kennedy’s own strategic thinking. For him, the treaty was a “first step” on the road to peace with the Soviet Union. But the president was assassinated soon after, and historians have speculated ever since about what might have happened had he lived.

Instead, the Cold War progressed for nearly three decades more, thawing at moments, hardening at others. Yet Kennedy had fundamentally altered its course. Presidential successors, especially Richard Nixon and Ronald Reagan, looked for openings to de-escalate tensions and foster peace.

Even if Kennedy didn’t live to carry out the full change he promised, he provides a model of leadership for the aftermath of the covid-19 crisis. Heads of every state will soon be faced with a choice and an opportunity: Do they use this crisis to produce real change? Only time will tell what each decides. But if they’re to succeed in delivering change, our leaders must borrow from the Kennedy playbook.

Like him, they must assess and confront where they’ve been wrong in the past. For instance: The horror scenes we’ve seen in hospitals are the result of decades of underfunding, and the consequence of a pervasive logic that puts market needs above human health in our health-care system. That logic has to be ditched — much the same way, that following the Cuban missile crisis, Kennedy abandoned his unflinching commitment to the Cold War.

The U.S. president was fond of saying “change is the law of life,” a quote that came from the “Bhagavad Gita.” What made Kennedy a memorable leader was his singular ability to react — and adapt — to change.

This shouldn’t be confused with opportunism or a lack of convictions. The very opposite: Kennedy found, and followed, his moral compass. He recognized the Cuban missile crisis had exposed the permanent danger of the policy of mutually assured destruction. He realized, “it is insane that two men, sitting on opposite sides of the world, should be able to decide to bring an end to civilization.”

But our leaders have more to learn from Kennedy than his capacity for righteous reinvention. The president’s plea for greater international cooperation is just as relevant today — in the throes of the covid-19 crisis — as it was over half a century ago. The pandemic, among other things, has resulted from a failure of the international community to take sensible, coordinated action early on. If we want to avoid situations like this in the future, not to mention rebuilding the world economy soundly, the solution is not to retreat into nation-states, but instead to forge stronger global partnerships based on the recognition we’re all in this together. This isn’t pie-in-the-sky, it’s just what Kennedy called “the necessary rational end of rational men.”

In the making of a post covid-19 world, Kennedy’s words on peace light the way: “Let us focus … on a practical, more attainable peace — based … on a gradual evolution in human institutions — on a series of concrete actions and effective agreements … in the interest of all concerned. There is no single, simple key to this peace … Genuine peace must be the product of many nations, the sums of many acts.”

Kennedy believed “man can be as big as he wants.” Will our leaders — and we — rise up to the challenge?