If you’ve ever wondered what it’s like to die by nerve agent — the kind of poison Russian President Vladimir Putin is known to use against his enemies — I highly recommend Alexei Navalny’s posthumous memoir, “Patriot.”

The story begins in the summer of 2020. Navalny, the charismatic Russian opposition leader and anti-corruption crusader, is on a plane en route to Moscow from Siberia, where he had been organizing candidates to run against Putin’s United Russia party. He is watching an episode of “Rick and Morty” on his laptop when he is stricken midair. He isn’t in pain, but his body and brain just seem to slowly shut down. The physical world no longer makes sense.

Soon, he is on the floor of the plane’s galley, lying on his side and staring at a bulkhead. He has been poisoned, he tells a flight attendant, and he is about to die.

“Spoiler alert,” he writes. “Actually I didn’t.”

The plane makes an emergency landing, and after a two-day pressure campaign spearheaded by his wife, Yulia Navalnaya, Russian authorities allow Navalny to be flown to Berlin, where he will spend 32 days in a hospital, 18 of them in a coma.

Unlike in the movies, however, he didn’t suddenly wake up.

“The whole process,” he writes, “was like a long-drawn-out and highly realistic journey through the circles of hell.”

A famous Japanese neurosurgeon was frequently at his bedside. The doctor shared a haiku that he had written in memory of his son, who had died in his arms at the age of 2. The poem so moved Navalny that he cried for days.

Later, Navalny discovered that there was no Japanese neurosurgeon, no dead toddler and no haiku. He had hallucinated the entire episode, even the poem that made him weep.

“When I’m asked what it’s like to die from a chemical weapon, two associations come to mind,” Navalny writes. “The Dementors from ‘Harry Potter’ and the Nazgûl in Tolkien’s ‘Lord of the Rings.’ “

His memoir is divided into two parts: an autobiography beginning with his birth in Ukraine and early disillusionment with his government, starting with its lies about the 1986 nuclear catastrophe at Chernobyl, which forced his family to move when he was 10; and a prison diary kept over the course of his three-year confinement at the hands of Putin.

Navalny’s enduring idealism, optimism and humor — even as he suffers terribly in a penal colony in the Russian Arctic nicknamed “Polar Wolf” — are striking and inspiring.

“It’s a real Russian spring day,” he wrote on April 3, 2023. “That is, the snowdrifts are up to my waist, and it’s been snowing all weekend.”

He fought to stay hopeful, and he refused to let Putin imprison his mind the way he had imprisoned his body in freezing “punishment cells.” He called his coping strategy “prison Zen,” imagining his incarceration as a kind of “space voyage.”

“One day, I simply made the decision not to be afraid,” he writes.

After his nine-year sentence for a variety of trumped-up “extremist activities” was extended an additional 19 years, he understood that he would probably die behind bars.

“I knew from the outset that I would be imprisoned for life,” Navalny writes, “either for the rest of my life or until the end of the life of this regime.”

The Russian authorities announced in February that Navalny had collapsed after a walk and died. No specific cause of death was ever confirmed, but he had been severely weakened by the 2020 poisoning, at least 300 days of solitary confinement in a punishment cell and a lack of adequate medical care.

Navalny could have avoided his imprisonment and death at 47. After he was poisoned, he could have stayed in Germany, or any Western country, with his wife and two children. On principle, however, he returned to Russia, to his country, his home, his mission.

“Our miserable, exhausted motherland needs to be saved,” he wrote on the two-year anniversary of his incarceration. “It has been pillaged, wounded, dragged into an aggressive war and turned into a prison run by the most unscrupulous and deceitful scoundrels. … I’m not going to surrender my country to them, and I believe that the darkness will eventually yield.”

Navalny’s widow has been promoting “Patriot.” She told the BBC that she hopes to return to Russia to carry on her husband’s pro-democracy work and run for president one day. Until Putin is gone, however, she would risk meeting the same fate as her husband — arrest, imprisonment and death.

Appearing on “The View” on Thursday, Navalnaya was asked whether she had a message for American voters. Her response was diplomatic: Don’t take anything for granted, she said. “You are still living in democratic country … and just make the right choice.”

Her husband was far more pointed in a letter to a friend last year.

“Trump’s agenda and plans look truly scary,” Navalny wrote. “What a nightmare.”

He knew better than most.

Robin Abcarian writes a column for the Los Angeles Times.