He was described as a beautiful boy with soulful brown eyes — moral, empathetic and gentle. Captain of the high school wrestling team and nominated to the National Honor Society, he was also a diligent student with high-achieving friends who knew they could call him at 2 a.m. if they needed a favor. “Saving lives brings me joy,” he once tweeted of why he became a lifeguard.

But now Dzhokhar Tsarnaev sits accused of violently ending some lives, maiming others and inflicting terror by setting off homemade bombs during the Boston Marathon.

Down in Sanford, Fla., another young man triggered unwarranted alarm merely for wearing a hoodie and walking in a gated community where an onlooker assumed he had no right to be. Because George Zimmerman felt uncomfortable with his appearance, Trayvon Martin ended up dead.

The cases, both of which have triggered fresh outrage, have one critical thing in common: Both show how wrong we can be when we try to predict people’s behavior according to the stories and stereotypes we’ve recorded in our heads about how they should or shouldn’t look, or act.

I share the outrage over the fact that the killer of an unarmed man doing nothing wrong got off without criminal sanction and never so much as expressed remorse. But the outrage over a Rolling Stone magazine cover photo said to glamorize Tsarnaev is misplaced.

In running that rock-star-like picture of an accused bomber, Rolling Stone was making precisely this point, that appearances can lie and terrorists aren’t necessarily recluses sporting long beards. They can be popular all-American athletes who smoke dope. They can embrace popular culture. They can even be hunks.

Based on his appearance and what little people knew of him, “terrorist” would not have been an outcome predicted for Dzhokhar Tsarnaev. It’s not that the friends, teachers and other acquaintances lied when they described him as a great kid. It’s that they missed a side of him that he was good at concealing.

He was, Rolling Stone concluded, a “deeply fractured boy” who didn’t start out believing in radical rhetoric. “As each small disappointment wore on his family, ultimately ripping them apart, it also furthered Jahar’s (his nickname) own disintegration — a series of quiet yet powerful body punches. No one saw a thing.”

Had closer attention been paid to the subtler clues Tsarnaev gave out — his sudden embrace of Islam, his contention that 9/11 was “an inside job” and the fact that non-Muslim friends were rarely allowed into his family’s apartment — people might have noticed a double life. Had they observed his gradual process of alienation, disconnectedness and anger, they might have worried.

People who study terrorists say this is how it most often happens. “Rather than say, ‘I’m lost, I’ve got a problem,’ it’s much easier to find a convenient enemy or scapegoat,’ ” Rolling Stone quotes Tom Neer, a retired FBI agent and now counter-terrorism adviser, as saying. “ ‘The justification comes later — say, U.S. imperialism, or whatever. It’s the explanation that is key.’ ”

The critical thing, said Neer, is looking past people’s exterior and getting access to “the secret side ... that they labor really hard to protect.”

Who’s to say if closer attention to Dzhokhar by those around him might have saved the Boston Marathon victims? Our justice system isn’t supposed to throw people in jail on mere suspicions. But if those close to him had been attuned and concerned enough about his anger and angst to try and get him help, it might inadvertently have prevented the horrible upshot. Instead, they deferred to outside appearances: The guy was chill.

What is absolutely clear is that had Zimmerman not jumped to conclusions about a black young man wearing a hoodie in a gated Florida community, Martin would still be alive.

If there is a lesson to be learned from both these tragic cases — one of missed clues, the other of overreaction — it’s that both kinds of presumptions, about who looks like one of the guys and who doesn’t, can be fatally flawed.

Profiling can leave innocent people dead. It can make us ignore warning signs of explosive rage brewing in someone close to us. It even, as we have learned, failed to predict a future president. We’ve got to stop relying on it.