In "The Zen Diaries of Garry Shandling," Judd Apatow offers a two-part, 4 1/2-hour, thoughtful, funny and moving deep dive into the life and art of a man important to him, to comedy and to television.

Shandling's "The Larry Sanders Show," on which Apatow worked as a writer, producer and first-time director, is where the vaunted New Golden Age of Television really begins.

But there was much before and after. The film, which reaches back into a childhood permanently scarred by the early death of Shandling's older brother, charts every step and misstep, every rise and fall in the comic's career, while questioning the very meaning of success itself.

Built around Shandling's journals (read by Michael Cera ), “The Zen Diaries,” premiering Monday and Tuesday, grew out of the memorial Apatow put together after the comedian’s sudden death from a heart attack in 2016. People who were there, said Apatow, "talk about it as if it was a religious event — because Garry was a seeker and he was someone who was wounded and trying to figure out how to heal those wounds and be a better and a more loving person. My goal was to create a documentary that made you feel the way the memorial made that audience feel."

Was there a moment when you knew there was something different about Garry Shandling?

Immediately. We hung out with a lot of funny people, but he was not just a great comedian, he was a visionary. He was reinventing television. And he was also a very sensitive person. I realized from moment one that he was someone you had to stay very in tune with and be very honest with. He didn't tolerate any [crap]. And there was an element of narcissism to it as well — he needed a lot of approval and presence from the people around him.

What would your life be like if you hadn't met him?

I can’t even imagine. He gave me my most important joke-writing opportunity, my most important sitcom-writing opportunity, my first directing opportunity, and in addition to that he read and gave me notes on every movie I ever directed. He taught me how to write, and he was a mentor in terms of spirituality — he would give me books by people like Pema Chödrön, Chögyam Trungpa. And up until that point I never thought about religion. So it was life-changing for somebody to say, "Well here's one way to look at reality," and that sparked my interest in Buddhism and Eastern religions.

When I’m working, I think about how Garry would look at things, and I preach his ideas to everyone I've ever mentored and worked with. So I feel like he's had a big influence on people who might not even know he's influenced them.

Bob Saget, left, as himself and Garry Shandling as Larry Sanders in an episode of "The Larry Sanders Show." Bernard Fallon/HBO

Do you think his own mentoring of younger writers and comics was intentional, or just due to the sort of person he was?

I think it's both. People would see his approach, see how seriously he took the work. Just watching him talk through an episode [of “The Larry Sanders Show”] was like sitting in an amazing class — here's how you think about a story and how you think about characters.

I was surprised to learn how many people he was mentoring and how seriously he took it. He didn't stumble into helping people. It wasn't because he felt burnt out and had nothing else to do. He made a conscious choice to give back to comedy.

Were you aware that he kept journals?

I may have had a vague sense that Garry kept journals, but after he passed it became clear there was an enormous amount of them, starting in 1977; they cover his start in comedy, all the way to writing about being sick and preparing for surgeries and thinking about death and letting go. He had been kicking around a project where he would use them as a starting point for some sort of hybrid documentary — he hadn't figured it out yet.

It's a great spine for the film.

Most documentaries can't be that honest. Usually, there are people who want the subject to be presented as more perfect than they actually were. I do think this is a rare situation where we were allowed to try to get to the truth, whatever that was. I thought Garry would want people to learn something from his life. When he's talking to Jerry Seinfeld in the "Comedians in Cars" clip, he says jokes are just an expression of your spirit and once you die they don't matter. And in making the documentary I thought that it only matters in the way it can help other people.

A young Garry Shandling, with short wave radio, as seen in Judd Apatow's HBO documentary, "The Zen Diaries of Garry Shandling." HBO

You show him at his best and worst — as when he goes on Conan O’Brien’s show and can’t get a laugh.

Being a comedian is about being sharp, so if you're going through something that puts you into a fog, it's almost impossible to execute it properly. And that was a time when people didn't know what Garry was going through; he kept his health issues very private. But he was always very kind and giving. I went through my emails — every time I asked him to do anything he said yes. It made me cry. But he was struggling, and it wasn't a struggle a lot of people understood.

Was this related just to the fact that he was sick?

​​​​​​It's hard to know. He had a thyroid problem, which people say mirrors aging, where he felt like he was just slowing down. And as a result of the thyroid problem he got the pancreatitis, which is a life-threatening illness. And in addition to that, I think he did get disenchanted by the business, by having these difficult experiences with [manager] Brad Grey and Mike Nichols [who directed him in “What Planet Are You From?”]. I think it broke his heart a little bit and made it harder for him to get excited about taking on a new project. Which for him was an epic battle. He didn't do things nonchalantly.

I always loved when [“The Larry Sanders Show”] was tense — I got a kick out of pressure to make it great. Some people it really bothered. It's not just that Garry's bar was so high — his bar was only visible to him. Conan O'Brien says in the documentary that Garry never wanted to do a talk show because he's an artist and can’t just grind out the meat every day. To me, that's what made working for him special. It was like jumping into the middle of boiling fire to write for the show, but anyone who did learned so much.

Your film does suggest that toward the end he was regaining his spirit.

In those years there were times he was feeling good and he would get onstage again, and in those clear periods he would get so funny; his joke-writing skills only got better. It really was about whether or not he wanted to pursue it. It always felt like he should write the new hour act, but he was trying to figure out a way to reinvent the form of stand-up comedy and became a little bit obsessed with silences and awkwardness and making the audience think about things they might not want to think about. He hadn't cracked how to do it, but he did seem to be moving in a direction that was very interesting.

What are your memories of his passing?

I got a call and they said Garry had a heart attack, and so I jumped in the car and went to the hospital. A couple of his friends were there, and we were slowly realizing that it was very serious. And before we were told what was happening it was on TMZ that he had passed away. For me, he was a real father figure, and I was devastated. Garry was someone you always thought would just be around until he was ridiculously old; he wasn't someone you thought would ever be taken away. And then once he's gone, you notice how often you would reach out to him; in so many situations Garry was the person you would ask for help.

For whom is this film intended?

I tried to make it so you would enjoy and appreciate his work and his journey even if you had never seen one joke of his. A friend of mine watched it and said, "I just kept thinking we're all on the exactly same journey as Garry." And because it takes its time and shows these key moments in his life it feels very relatable — a young kid has a tragedy that helps form his personality and gives him a drive to succeed, and he succeeds and it gets more complicated and people let him down and he wonders what life's about — he wonders why he even chased his dream. He tries to figure out what's important and what's not important, he tries to give back as much as he can while he's here, and suddenly he's gone. And in a way that's everybody's journey.

‘The Zen Diaries of Garry Shandling’

Where: HBO

When: 8 p.m. Monday and Tuesday

Rating: TV-MA (may be unsuitable for children under the age of 17)

Support our journalism Please consider subscribing today to support stories like this one. Get full access to our signature journalism for just 99 cents for the first four weeks. Already a subscriber? Your support makes our work possible. Thank you.

robert.lloyd@latimes.com