 -- John Mulaney, the Emmy Award-winning writer and comedian turned Broadway actor, said he was struggling with anxiety after his sitcom was canceled last year and turned to meditation to help get back on track.

In an interview with ABC News' Dan Harris for his "10% Happier" podcast, Mulaney said he first tried meditation while he was working on “Mulaney,” a Fox sitcom in which he starred as a fictionalized version of himself. At the time, Mulaney already had two acclaimed stand-up specials -- “The Top Part” in 2009, followed by the Comedy Central special “New in Town” in 2012. He is also known for his work on “Saturday Night Live” -- he starred as a “Weekend Update” correspondent and co-created the character Stefon with SNL alum Bill Hader.

The show "Mulaney" was granted a six-episode commitment at first, but then Mulaney said they waited almost three months to hear whether it would be extended before getting the green light to shoot seven more episodes.

“I was having anger for the first time, out loud, while working on the TV show,” he said. “I lost my temper, not the on the set but over the phone ... and it was weird and it felt out-of-body and it felt uncontrollable.”

FOX via Getty Images

During that three-month break in between the show’s production, Mulaney started reading Harris’ book, “10% Happier: How I Tamed the Voice in My Head, Reduced Stress Without Losing My Edge and Found Self-Help That Actually Works – A True Story.”

“I was probably at peak stress, but peak ambition and on some level, just not at all liking the balance I had, and kind of feeling like ... I was living on Mars and I wasn’t comfortable there,” Mulaney said. “But I had the feeling that I could not be introspective or I would lose momentum.”

Harris’ book was a “jumping off point,” he said, to give meditation a try. But the first time, Mulaney said he tried meditating for a few minutes and hated it. But then later he decided to commit to trying it for 15 minutes a day, and after about five days, he said he noticed a difference.

“I got an email from-- regarding an edit of an episode that normally would of spike my anger levels out of control,” Mulaney said. “And I remember reading it and I was able to kind of process it and I was also able to separate the good experience of shooting the episode from the difficult experience of what was going to get edited down in the episode ... and I just remember thinking, ‘That does not change the fact that you had a good time making it.’”

Watch the full interview in the video player and download the "10% Happier" podcast on iTunes, Google Play Music and TuneIn.

Mulaney said he more or less gave up meditation when the show when back into production. “Mulaney” was poorly received by critics and canceled in January 2015 after one season and almost immediately, he decided to go back to doing what he knew best -- stand-up comedy.

"When you have something that you did so many jobs on, and were so front and center on, and then people dislike it, you want to learn lessons from it and you want to move on, and you want to move on too fast," he said. “[The show] was canceled and I went on the road four days later, thinking like, ‘I’m just going to leave this behind me and go back to being a stand-up and I’ve totally processed this experience,’... I hit a wall fast realizing I couldn’t outrun it.”

While he was on the road for his tour, Mulaney said he started meditating again after having “a lot of episodes of panic,” in which he would feel very anxious all day before a show.

“I was doing shows in Sacramento and every bit of anxiety I ever had just came crashing down,” he said. “I was just sitting in the hotel being like, ‘Oh man, I’m done.’

Stand-up had always been something he loved performing, Mulaney said, but "walking around being like -- ‘Does everyone hate me? Have I totally ruined my life? Have I totally ruined my career? Is there any coming back from this? There’s probably no coming back from this. This is one of those things there’s no coming back from this’ -- having all those thoughts alone in a hotel room in Sacramento is ... it's physically-uncomfortable-for-me anxiety that ruined the whole experience leading up to a show."

Kevin Winter/Getty Images

In addition to his stand-up tour, Mulaney found success with a third stand-up special on Netflix called “The Comeback Kid,” released in November 2015, and by December 2015, Mulaney said he had committed himself to a regular meditation practice.

“[Meditation] didn’t always help in the moment, and it didn’t always help that day,” he said. “But I think the cumulative effect of [practicing] was very, very good ... but I had days where I would meditate for 20 minutes at the hotel and then meditate for seven minutes backstage just to kind of ground [myself]...but I still would be-- 'I'm still flooded with all these thoughts.'"

There were many weeks where the practice felt “pointless,” he said, because he kept having feelings of self-doubt and anxiety every time he went to a new city on his stand-up tour, but he stuck with it.

“It was physically uncomfortable, the anxiety, enough that I was always happy to exercise or sit down meditate,” he said.

Mulaney says now he’ll notice if he hasn’t been meditating for a while because he’ll feel the anger and anxiety rise up again. He now meditates for 20 minutes every day, usually while sitting in a dark dressing room at the Lyceum Theater in New York City where he and his friend and fellow comedian, Nick Kroll, star in the two-man Broadway show they wrote together called “Oh, Hello,” now running performances until Jan. 22.

And his next step after this? "I'll be going on tour doing stand-up," he said.