Kelsey Grammer has made audiences laugh as radio psychiatrist Dr. Frasier Crane for 20 years in both “Cheers” and “Frasier,” but off-camera, the 62-year-old actor has endured several tragedies.

The sitcom star first endured heartache at age 13 when his father was killed during a home invasion. Then a few years later, his younger sister Karen was raped and murdered when she was 18. Grammer was the one who initially reported her missing. Then his two half-brothers, Stephen and Billy, perished in a scuba-diving accident in the Virgin Islands.

Grammer relied on alcohol and drugs to cope and eventually served prison time for drunk-driving violations in 1990 before finding sobriety in rehab.

“I just put [that pain] where it is: in the past,” said Grammer to UK’s i News. “But it’s a pain that you can always stumble into again — it’s with you 24/7, especially in the case of tragic death, and there have been a few of those. It’s just part of life. Maybe I learned a little earlier than most, but it’s just the way it goes.”

However, Grammer’s misfortunes didn’t end there. After three failed marriages, he found love with British former flight attendant Kayte Walsh, but after he survived a heart attack in 2008, she suffered several miscarriages.

“Kayte and I had a couple of miscarriages before we had our first child,” he admitted. “That was devastating. These things are hard. But when it’s good, it’s magnificent.”

Kayte Walsh, Kelsey Grammer and son Kelsey Jr.KDNPIX

But these days, Grammer is in a better place. Thanks to his marriages, he is a proud father of seven: 33-year-old Spencer, 25-year-old Greer, 15-year-old Mason, 12-year-old Jude, 5-year-old Faith, 2-year-old Kelsey Jr., and 8-month-old Auden.

“It takes me a while to figure things out,” he said on his former relationships. “I usually have to repeat a lesson or two — maybe three times! I survived my previous relationships just in time to land in a place where I could be in a relationship with a terrific person.”

Grammer is also starring in “The Last Tycoon,” a series based on F. Scott Fitzgerald’s unfinished novel, opposite Lily Collins. He also relies on faith to keep him motivated as a successful actor in Hollywood.

“As a Christian, we always fail because we can’t become Christ,” he said. “But I can try to at least emulate the best qualities, even if I may fall short.”