Evan Thomas is the author of “Robert Kennedy: His Life” and “First: Sandra Day O’Connor.”

For people to die young, in their prime, before their time, can seem like an offense against nature. In Japan during World War II, on the eve of their fatal flights, kamikaze pilots often wrote letters apologizing to their parents for causing them grief with their premature deaths.

Young men fight in wars, and they die. But when we hear about a young man or woman passing away just as he or she is beginning to fulfill the promise of youth, it can feel profoundly wrong. Sometimes we glorify or romanticize them, perhaps to fend off our own sense of mortality.

William D. Cohan’s “Four Friends: Promising Lives Cut Short” is an engaging, unsettling book. His story of the untimely, violent departures of four of his schoolmates may make the reader feel angry at the sheer waste and carelessness of their deaths. It is also an intensely humane work by a skillful writer of nonfiction narrative who knows how to make you forgive even as he damns. That one of his subjects is John F. Kennedy Jr. adds to the drama, though all of his characters are sympathetic, even if you want to smack their pretty heads.

A longtime Vanity Fair writer, Cohan does a bit of huffing and puffing to set the scene. Like his subjects, he attended Phillips Academy, the Massachusetts boarding school called Andover by its graduates. “People emerged from Andover thinking they could do, or be, anything they wanted,” Cohan writes in his prologue. “That idea that we really were la crème de la crème de la jeunesse américaine, as we were told regularly, that we were some kind of young, invincible Delta Force, was intoxicating.” I graduated from Andover eight years before Cohan, and the school was and is demanding, but Delta Force it was not. Still, there is no doubt that many students felt high expectations and pressure to perform, sometimes from their parents, sometimes from the school. In the mid-’60s, students tried to compensate with a thick veneer of cynicism and sarcasm. In Cohan’s more liberal era of the mid-’70s, when the drinking age dropped to 18 and drugs arrived on campuses everywhere, the preferred buffers were pot and alcohol.

As teenage schoolboys, three of Cohan’s four heroes seem to have been as intent on getting high as on getting into Harvard, none more so than JFK Jr. “John always liked to push the disciplinary envelope at Andover, if in a charming way,” Cohan writes. “He didn’t intentionally flaunt the rules as much as sort of pretend they never really existed in the first place, since it was pretty clear from his own experiences in life that the rules of the road would never apply to him anyway.”

Death on the cusp of middle age is the fate of all of Cohan’s characters. The most shockingly inexplicable is that of Jack Berman, the studious, abstemious son of Holocaust survivors who fulfills his parents’ dreams by becoming a successful lawyer — and, at age 36, is gunned down by a random madman who hates lawyers.

The other three characters contribute significantly to their own demise. Will Daniel is a grandson of President Harry Truman and a son of Clifton Daniel, the managing editor of the New York Times. At Andover, he hangs out with the stoners, but he still gets into Yale. Perpetually adrift, he is at once prone to angry outbursts and gently caring for mentally ill people and AIDS sufferers at homeless shelters in New York. Drunk late one night, he steps in front of a fast-moving cab, probably accidentally, though maybe not.

Brilliant as well as entitled, Harry Bull floats through Andover in a haze of pot and drops out of Yale after a semester. But he straightens up, goes into the family business, and is happily married with two little girls and an infant son. One warm summer afternoon, he takes his daughters, ages 7 and 5, sailing. The small sailboat is found, empty and drifting, the next day. There is no evidence of foul play. It may be that Harry, an excellent swimmer and sailor who liked to jump in Lake Michigan on hot, calm days, went swimming with his girls (no life jackets) and the outboard engine somehow engaged or a puff of wind carried the boat away.

JFK Jr.’s death was even more reckless. “Enabled” does not begin to describe his charmed, doomed existence. At Andover, a school normally unforgiving of failure, he is repeatedly pardoned for academic disaster. At Brown, Kennedy had the “bad habits of borrowing money and of losing his wallet, which occasionally had some borrowed money in it,” writes Cohan.

Kennedy’s friends at Brown recalled how people threw themselves at their famous classmate, physically and emotionally. One of them, John Perry Barlow, recalled that “people would come up to him, and you could see them just shedding IQ points as they approached. I mean, the closer they got, the dumber they were.”

Kennedy both courted attention, lounging about public places bare-chested, and hated it. “THE HUNK FLUNKS . . . AGAIN,” jeered the New York Daily News the second time he flunked his bar exam. John’s favorite drug, among many sampled, was his own adrenalin. He had various near-death experiences paddling kayaks in dangerous waters and piloting a kind of flying parachute called the Dream Machine, which he crashed, breaking his leg.

His marriage to Carolyn Bessette and his political/celebrity magazine, George, were both failing when, unqualified for flying by instrument, he took off with his wife and her sister into the thick haze that July night 20 years ago. At the time, he was seriously thinking of running for governor of New York. After all, who was to tell him no?

Four Friends

Promising Lives Cut Short

By William D. Cohan

369 pp. $28.99