This October marks the 55th anniversary of the Cuban Missile Crisis, the closest the world ever came to thermonuclear war.

I’ve been reading about it this summer as the war of words between our president, Donald J. Trump, and North Korea’s Kim Jong Un escalates, along with that country’s missile program. On Tuesday The Washington Post reported that North Korea can now miniaturize nuclear warheads that can fit in its missiles, which now may be able to reach California.

In response, Trump spontaneously threatened that North Korea would “be met with fire and fury, and frankly power the likes of which this world has never seen before.” Hours later Kim vowed to encircle the U.S. territory of Guam with “an enveloping fire.”

U.S. on North Korea: 'We're Speaking With One Voice'

To say the rhetoric is heating up is a huge understatement. We are quickly moving toward a crisis that has many parallels with the epic showdown in the Caribbean more than half a century ago. I’ve written here that a North Korean crisis — especially, God forbid, a second Korean War — would be the biggest threat to global stock markets. It also could become an existential threat to millions of human beings.

That’s why it’s essential to revisit the decision making of President John F. Kennedy, his brother Robert F. Kennedy, and their advisers during the 13 tense days in October 1962 when the U.S. and Soviet Union were eyeball to eyeball at the brink. (I recommend Michael Dobbs’ “One Minute to Midnight,” RFK’s brief narrative “Thirteen Days,” and the movie of the same name, starring Kevin Costner.)

The crisis began when Soviet leader Nikita S. Khrushchev wanted to shore up the regime of ally Fidel Castro, which had beaten back a U.S. invasion at the Bay of Pigs the year before, by secretly placing offensive Soviet missiles on that island.

On Oct. 16, 1962, President Kennedy learned that the Soviets had shipped in medium- and intermediate-range ballistic missiles capable of hitting any city on the East Coast. The president kept the news under wraps for nearly a week, then, in a televised address on Monday, Oct. 22, released it to the world.

The full speech is 18 minutes long, but well worth your time. Sober, detailed, tightly reasoned, long on determination but short on bluster, it’s a speech I don’t think any of the last three presidents could have given, especially the current one.

JFK laid out the facts and announced a course of action — a naval blockade, or quarantine, of Cuba — and demanded the Soviets remove the missiles. Ultimately Khrushchev backed down and agreed to do that in exchange for a pledge by the U.S. not to invade Cuba and a secret side deal to remove our own nuclear missiles from Turkey.

During those 13 days, the 45-year-old Kennedy and his 36-year-old brother made several key decisions that the 71-year-old Trump could learn from, if he made the effort:

Kennedy resisted advice to attack Cuba. Despite intense pressure from military leaders like Gen. Curtis LeMay to bomb the missile sites, JFK said there was no guarantee the U.S. could destroy them all and the risk of nuclear retaliation was too high. Instead, he initiated the quarantine, which, said Defense Secretary Robert S. McNamara, “applied pressure against the Soviets without ever pushing them to the point where they were forced to an irrational, suicidal, spasm response.”

He always gave Khrushchev a face-saving way out. “Every opportunity was to be given to the Russians to find a peaceful settlement which would not diminish their national security or be a public humiliation,” RFK wrote. “I am not going to push the Russians an inch beyond what is necessary,” the president said.

He stayed cool and sweated the details. President Kennedy remained calm amid the most intense pressure any world leader has ever faced. “Again and again he emphasized that we must understand the implications of every step,” wrote RFK. “We had to be aware that… the president was deciding for the U.S., the Soviet Union,…and really for all mankind.”

He knew his history. Kennedy, who rescued several shipmates from the burning PT-109, knew war firsthand, as did Khrushchev, who was in the epic battle of Stalingrad. JFK had also read Barbara Tuchman’s bestseller, “The Guns of August,” about the mistakes and miscalculations that had led to the catastrophe of World War I.

“I am not going to follow a course which will allow anyone to write a comparable book about this time, ‘The Missiles of October,’” he told his brother.

The Soviet Union’s reliable intermediate-range nuclear missiles in Cuba were probably a more serious threat to the U.S. than Kim’s long-range missiles, whose accuracy is uncertain, though they could surely wreak havoc on South Korea and Japan.

But unlike Castro, whom Khrushchev kept on a short leash, Kim has no real master, not even China. His paranoid personality is a real wild card.

Unfortunately, so is Donald Trump, whose fragile ego constantly demands adulation and who may feel “that somehow the North Korean leader is attacking his manhood,” as former Defense Secretary Leon Panetta said. Maybe all this tough talk will work where sanctions and diplomacy didn’t. More likely, Trump and Kim are a toxic twosome who bring out the worst in each other.

The stakes are very, very high, so we Americans must insist that our commander in chief learn a thing or two from a president who got us through the most dangerous crisis the world has ever seen.