Simon Pegg has brought a bit of Hollywood with him. Not just the shades and a shiny smile, but the scorching weather, too. This setting seems apt. Pegg is here to promote his latest outing in the Mission: Impossible franchise, and – because this is the start of his promotional campaign and because he adores the fact he gets to star in Mission: Impossible films alongside Tom Cruise – he is raring to go.

“You have caught me at the best possible moment,” he says, shaking my hand and downing a coffee. “This will be the most enthusiastic, positive and interesting I will ever be. You have got the mother lode!”

And then he sits down to talk about depression. And alcoholism. And how he spent years trying to hide it, and how he nearly lost everything, and how he is lucky to even be alive. “It was awful, terrible,” he says. “It owned me.” Suddenly, this roof terrace in east London doesn’t seem so sunny.

The narrative with Pegg has always been a heartwarming one: young sci-fi geek turns his obsession into a comedy career, writes a brilliant sitcom (Spaced) and a fun comedy zombie film (Shaun of the Dead), before somehow ending up starring in the same kind of space adventure blockbusters he grew up with. His rise is often portrayed like a film script, as if he didn’t so much work his way up to a career as found it tucked inside a Wonka bar. His puppyish enthusiasm and permanent “Am I really here with all these famous people?” expression only added to the narrative. It was a tale into which drink-fuelled oblivion did not fit too neatly.

“I would feel like – I’m in a film with Tom Cruise, I’ve got the part of Scotty in Star Trek. This should be making me feel happy,” he says. “But it wasn’t.”

It was the start of a long and tortuous journey. Pegg, now 48, says he had been aware that he suffered from depression since he was 18, but until 2005 had always dealt with it by self-medicating. He would feel sad, he would have a drink, he would feel better. Repeat when needed. There was no time to stop and thinkabout it – he had a career to build and countless projects to get through. But after flying to Los Angeles to shoot Mission: Impossible III (2006), things started to unravel.

“When I watch that film back, I can see where I was then, which was fairly lost, and unhappy, and an alcoholic,” he says. It was the start of what he calls “the crisis years” – although most of his fans will have been blissfully unaware of it. “Because I hid it,” he says. “I’m an actor, so I acted … all the fucking time.”

Did he employ the same skills? “Sometimes I did,” he says, admitting that he even kept his problems hidden from his best friend and frequent co-star, Nick Frost. “One thing [addiction] does is make you clever at not giving anything away. People think junkies and alcoholics are slovenly, unmotivated people. They’re not – they are incredibly organised. They can nip out for a quick shot of whisky and you wouldn’t know they have gone. It’s as if … you are micro-managed by it.” He lets out a burst of manic laughter – Pegg is remarkably chirpy today, despite the subject matter. “But eventually the signs are too obvious. You have taken the dog for one too many walks.”

Facebook Twitter Pinterest From left: Simon Pegg, Rebecca Ferguson, Tom Cruise and Ving Rhames in Mission: Impossible – Fallout, out on 25 July. Photograph: Allstar/Paramount

A turning point for Pegg came after his daughter, Matilda, was born – not because it snapped him out of it, but because it didn’t. “It was the most cosmic experience of my life,” he says. “I thought it would fix things and it just didn’t. Because it can’t. Nothing can, other than a dedicated approach, whether that’s therapy or medication, or whatever.”

A year after Matilda’s birth, Pegg was at the Comic-Con convention in San Diego, California. He was promoting his movie Paul, but during the trip went awol for four days. On his return to the UK, he says he could not make it home from the airport without stopping off for a couple of pints. That proved to be the metaphorical dog-walk-too-far for his wife. “It was obvious to her,” he says, before adding with a touch of comic emphasis. “And then I woke up in the Priory.”

Pegg credits rehab with turning things around: “I got into it. I got into the reasons I was feeling that way. I went into AA for a while, too.”

How destructive had it become by this point? “I don’t think I would be here now if I hadn’t had help.”

All this talk certainly puts into fresh perspective his 2013 film, The World’s End, in which he plays Gary King, a man so determined to complete a youthful pub crawl with his schoolfriends that he refuses to quit, even when it starts endangering their lives.

“I felt like I was kind of telling people with that movie,” he admits with a smile. “Because that’s what addiction is like. It’s like you have grown a second head and all it wants to do is destroy itself, and it puts that ahead of everything else – your marriage, children, your job.”

At the time it was going on, Pegg says he had to get court orders to stop stories of his recovery getting out in the media. “They were sinking so low as to phoning up where I was and pretending to be my mother to get the story,” he says. Now that he has recovered, and mellowed significantly, he says he wants to tell that story. “I’m not ashamed of what happened. And I think if anyone finds any relationship to it, then it might motivate them to get well. But I am not proud of it either – I don’t think it’s cool, like I was Mr Rock’n’roll, blackout and all that shit. It wasn’t, it was just terrible.”

Facebook Twitter Pinterest Simon Pegg as Scotty and Sofia Boutella as Jaylah in Star Trek Beyond. Photograph: Kimberley French/AP

Funnily enough, the crisis that reached a head with Mission: Impossible III started to resolve itself around the time of the movie’s 2011 follow-up, Mission: Impossible – Ghost Protocol. Pegg says he went into recovery as shooting started, and if you rewatch the film with eagle eyes you will notice him returning to health as the movie progresses. “We always laugh about it when we watch the movie. Try it! You’ll be like: ‘Fuck, he’s got cheekbones suddenly!’”

Pegg loves returning to play Benji Dunn, the sidekick to Cruise’s Ethan Hunt, whose journey from lab nerd to field agent mirrors his own Hollywood journey. “Like me, he’s still impressed by it all, yet at the same time finds it all fairly ridiculous.” For Dunn’s latest outing in the forthcoming Mission: Impossible – Fallout, Pegg clocked up 144 days of shooting, more than he had done before. This was partly because Cruise broke his ankle during a stunt, which caused production to shut down for a while.

“Of course, he just got up and ran out of shot on a liquid ankle,” marvels Pegg. “He had his producer head on even as he hit the building, and thought: ‘If I don’t clear this shot, it’s going to cost a lot of money to reshoot it.’”

You might say that an injury like this has been on the cards. The Mission: Impossible franchise prides itself on the fact the actors pull off the stunts themselves. Pegg believes this knowledge adds a frisson of tension in the audience. “A couple of times, Tom’s done stunts where you think ‘he might not live through this’,” he says, seemingly deadly serious. “When we left him in New Zealand to shoot a scene where he sent a helicopter into a tailspin, it was like: ‘Well, goodbye, maybe see you in London?’”

Pegg has to get involved, too. He has learned to drive a twin-engine speedboat and venture underwater with a rebreather to complete his scenes. “You can’t tell it’s me with all that stuff on,” he says. “I was thinking about this while I was underwater, which was really uncomfortable and difficult, and I realised: ‘I don’t really need to do this, do I?’”

Has he come close to getting injured? Only if you count a punch in the face. “The director, Christopher McQuarrie, gave me a note to pause a little longer before taking a punch in a fight scene. Unfortunately, he didn’t give the stuntman the note so he just hit me in normal time.” Did he stay professional and make sure he cleared the shot, like Cruise? “No!” he exclaims. “I just went ‘Owww!’”

Facebook Twitter Pinterest Simon Pegg and Kate Ashfield in Shaun of the Dead. Photograph: Rouge Pictures/Everett/Rex Features

Pegg’s 12-year working relationship with Cruise has long since blossomed into a proper friendship. You can tell that Pegg, mirroring the pair’s on-screen chemistry, gets a thrill from being around the megastar, even if there is a degree of mystique around him that even those close to him can’t penetrate.

“I have never discussed his beliefs with him, for example,” Pegg says. “Everyone always asks: ‘Did he try and convert you? Is it all Scientology?’ But I’ve never seen that. I have glimpsed it a little bit – people from the church have been on set now and again, but he doesn’t proselytise about it.”

He smiles: “Obviously part of me wants to go: ‘What the fuck is that all about?’”

Pegg believes Cruise is misunderstood. “People are quick to want to denigrate him, but there is a complexity to him. He is way more than just a mad alien. The weird thing about that couch-jumping thing [in 2005, Cruise demonstrated his love for Katie Holmes by leaping on Oprah Winfrey’s sofa] is that it came about when YouTube first appeared and so people leapt on it. He was just being a bit of a knob, that was all. But people want more dirt and horror than that.”

Before I met Pegg, I was warned that he wasn’t the easiest to interview. That he could be prickly – difficult, even. Maybe I have caught him on a good day, but there is no sign of this. Not only is he open about his drink problems, he also merrily riffs on all kinds of topics, from #MeToo (“It’s time for men to take a backseat and just listen”) to his trip to the White House a few years back (“I watched Michelle do this incredibly eloquent speech, all off the cuff, and just thought ‘I can’t imagine the Trumps ever being in this place’”).

He once wrote a Marxist analysis of Star Wars and can’t help peppering our chat with his pet theories on, say, the representation of masculinity in action films, or home cinema’s detrimental effect on community. Yet despite this, he maintains that his depiction as an uber-nerd is off the mark. “Star Wars had a huge influence on me, but it was never the be all and end all,” he says, a little defensively. “I get characterised as this sort of nerd and I can be nerdy ... but it doesn’t define who I am.”

This sounds a bit rich for someone who wrote an autobiography called Nerd Do Well. “I played up to it and I fostered that in some respects,” he accepts. “But there is a side to me that likes films that have nothing to do with spaceships, too.” Besides, he says, science fiction was more substantial during his youth, containing serious adult themes beyond the sparkly effects. Nowadays, a lot of what gets called nerd culture is just “children’s entertainment. The adult population is going to see films about superheroes and spaceships – myself included – and there’s a strange kind of infantilisation that’s going on. These are the preserve of our childhood, but now we don’t have to grow up until we are 30, or even 40.”

Facebook Twitter Pinterest The World’s End featuring (from left) Martin Freeman, Paddy Considine, Simon Pegg, Nick Frost and Eddie Marsan. Photograph: Allstar/Focus Features/Sportsphoto

Is that dangerous? “Yeah! It makes us all out of touch with reality. It seems amazing to me that there’s probably more discussion online about the next superhero movie than there is about immigration. Maybe now the state of the world is getting harder to ignore and people are starting to wake up to it a bit. Or maybe people will just feel even more powerless and think: ‘I can’t do anything, I might as well just watch this film and get away from the awfulness of it all.’ But the awfulness is festering more and more as we sit in the darkness watching these bright colours.”

Pegg’s future work suggests a desire to explore other areas without abandoning his roots entirely. He is set to appear in Lost Transmissions, an indie film written and directed by Katharine O’Brien about a music producer with schizophrenia. “In terms of wrestling with your own psyche, I had some knowledge,” says Pegg. He is keen to stress that depression and schizophrenia are different conditions. He is also gearing up to work with Frost again on the TV comedy Truth Seekers, which is about a team of paranormal investigators, although Pegg says he will only be producing with Frost, rather than starring alongside him.

Beyond work, though, Pegg just seems happy. He no longer drinks, he has got a peaceful life in Hertfordshire with his wife and dogs, and he is able to enjoy fatherhood as the cosmic experience he always knew it was. He beams with pride while telling me he has invited the YouTube star Stampylongnose to the Mission: Impossible – Fallout premiere so Matilda can meet him (“That’s who she worships … she doesn’t give a shit about Tom Cruise”).

Despite the turmoil, or perhaps because of it, he seems at ease with himself today. “Doing the school run, picking up dog shit, all that stuff is what’s important to me and I need to keep doing it,” he says, with another manic laugh. “I had to deal with a disgusting one this morning,” he adds, grimacing at the memory. “It was like Armageddon. But as I crouched on the floor with a wet wipe in my hand, I did stop and think to myself – this is the life.”

• Mission: Impossible – Fallout is in cinemas on 25 July in Imax, 3D and 2D.