Illuminating the late Philip Seymour Hoffman’s longtime struggle with addiction, Mimi O’Donnell, his partner and mother of his three children, opened up about their relationship in a heartbreaking new essay for Vogue.

O’Donnell also wrote about the triggers that led to Hoffman’s relapse after two decades of sobriety and his death at age 46.

The Oscar-winning “Capote” star died of an overdose in 2014 involving a powerful cocktail of drugs. Hoffman’s body was found in the bathroom of his New York apartment with a syringe still in his forearm — heroin, cocaine, benzodiazepines and amphetamine were found in his system, causing “acute drug intoxication,” the coroner’s report said.

“I had been expecting him to die since the day he started using again, but when it finally happened, it hit me with brutal force. I wasn’t prepared. There was no sense of peace or relief, just ferocious pain and overwhelming loss. The most difficult — the impossible — thing was thinking, How do I tell my kids that their dad just died? What are the words?” she wrote in her essay, published Wednesday.

The costume designer-turned-director and producer said Hoffman had been frank about his addiction and stints in rehab when they started dating in 2001.

“Being sober and a recovering addict was, along with acting and directing, very much the focus of his life,” O’Donnell wrote. “But he was aware that just because he was clean didn’t mean the addiction had gone away.”

As his career picked up after 2005’s “Capote” and their schedules brimmed fuller, the family implemented an informal rule to never spend more than two weeks apart. Hoffman insisted on it and flew O’Donnell and their children — Cooper, Tallulah and Willa — to his filming locations, no matter the conditions. “We’re all doing it together,” he would say.

“I wonder whether Phil somehow knew that he was going to die young. He never said those words, but he lived his life as if time was precious. Maybe he just knew what was important to him and where he wanted to invest his love,” O’Donnell wrote.

O’Donnell hesitated to ascribe “The Master” star’s 2012 relapse to just one thing. There were several triggers, she said, some “common to men in their 40s” and others were more specific, including his discomfort with celebrity, the death of his longtime therapist and a falling out with his AA friends.

“Phil had a love/hate relationship with acting,” she said. “The thing he hated most was the loss of anonymity. He was making film after film — we had a big family and had bought a bigger apartment — and AA started to get short shrift. He’d been sober for so long that nobody seemed to notice. But something was brewing.”

Hoffman began wanting to drink again, and did, despite O’Donnell’s telling him it was a terrible idea. It was a red flag that eventually led him back to drug use. After he closed “Death of a Salesman” on Broadway in the summer of 2012, he started using prescription drugs again, then heroin.

“As soon as Phil started using heroin again, I sensed it, terrified. I told him, ‘You’re going to die. That’s what happens with heroin,’ ” she said.

Hoffman checked himself in and out of rehab repeatedly, and though he maintained sobriety occasionally, “it was a struggle, heartbreaking to watch,” O’Donnell said.

“It happened so quickly,” she wrote. “Phil came home from Atlanta [where he was shooting ‘Hunger Games’], and I called a few people and said that we needed to keep an eye on him. Then he started using again, and three days later he was dead.”