In February last year, Kevin Smith performed 90 minutes of standup for a TV special, padded back to the green room and started to worry that the joint he had smoked before the show was too strong. He was sweaty and nauseous, which was not entirely out of the ordinary. But after he lay down on the tile floor and vomited, he was rushed to hospital, where a doctor broke the news that Smith was having a massive heart attack.

Smith stayed calm. Honestly, he tells me, as we talk at his Hollywood Hills home, he was still stoned. On learning that he might die, he says: “I was like: ‘I’m going to make peace with this right away.’ You did way more than you ever set out to do, you got to do some cool shit, and if it’s done, it’s done.”

For 25 years, Smith, a director and actor as well as a comedian, has grappled with his own dumb luck. In 1994, his debut film, Clerks, a raunchy comedy about the convenience store where he worked, was a hit with Sundance audiences charmed by Smith’s on-screen appearance, as a slacker known as Silent Bob, and his behind-the-scenes stories of selling cigarettes during the day and shooting the movie at night. Made for just $25,575, Clerks was funded by credit cards and favours from friends, some of whom even had parts in the film: Brian O’Halloran, for instance, plays Dante Hicks and delivers the catchphrase, “I’m not even supposed to be here today!” and Smith’s middle-school chum Jason Mewes, who agreed to play Jay, the talkative half of Jay and Silent Bob (Smith), two friendly morons with flashes of brilliance. Harvey Weinstein’s Miramax bought Clerks and, as its publicists had done with Quentin Tarantino and Robert Rodriguez, turned the filthy-mouthed former altar boy, the 24-year-old son of a New Jersey postal worker, into a star.

“I’ve been living on that one trick for a long time,” admits Smith. “Like, come on, that movie was cute – but 25 years on the back of one black-and-white movie?” Lighting a branded Jay & Silent Bob joint with his face on the packaging, he describes that Sundance wunderkind as if he were someone else.

“I love that guy. I don’t understand why he had the confidence. I think he was undereducated. I was never ambitious. I think that was a fluke.”

A fluke that became the cornerstone of his future, of his gorgeous three-story house decorated with memories: a table-top football game inspired by the roof hockey in Clerks, iron fireplace statues of Matt Damon and Ben Affleck in Dogma, a walrus ceramic that nods to his screwball gothic Tusk, crayon sketches, movie posters and souvenirs from the live stage monologues in which Smith extemporises on everything from phone chats with Bruce Willis to his dog’s genitalia. (He has sold out Carnegie Hall.) The upstairs living room is dominated by a collage celebrating his 20-year marriage to Jennifer Schwalbach. Squint, and you can find his first email to his future bride: “You’d be surprised how many Schwalbachs there are in the phonebook …”

“The house is a me-seum that highlights the accomplishments of Kevin Smith,” he jokes. When he looks around, he is reminded of everything he did that he never expected to do. “That’s why, when I almost dropped dead, I was OK with it,” he says. “Most days I’m like: ‘Oh, I probably did die on the table and this is heaven.’”

Brian O’Halloran and Jeff Anderson in Kevin Smith’s 1994 film Clerks. Photograph: Allstar/Miramax

Back to that operating room. The doctor asked if the Smiths had a history of heart disease? No, replied Smith. Only that his father died of a massive heart attack – and that his mother, who is still alive, had stents inserted in her arteries after her heart stopped for a full minute, during which she claims to have seen his deceased dad and grandmother. “She was probably pumped on fentanyl when she saw heaven,” Smith chuckles, “so I don’t know if I want to invest in that.

“I was a fat kid,” he continues. At 14, he joined Weight Watchers, but felt awkward being the only teenage boy and left after a month. As the third child of parents who were strapped for money and time, the only health food he saw was tinned spinach. “That’s why I don’t like vegetables.”

When he earned money to buy his own snacks, he devoured “low-fat” cookies not realising they were packed with sugar. “Oh, I fell for it all,” he says. The biggest hurdle, however, was mental. Over the years, he had embraced his weight, turning fat jokes from a problem to a comedic purpose. “The key early on was realising if I make fun of myself for this, then somebody else can’t. One day you think: ‘I could be funny for a living.’”

He marketed himself as a character – the happy schlub in a hockey jersey – and literally became a cartoon, as Clerks went from indie movie to comic book to sequels to animated series. Success, Smith notes, gave him an extra padding of protection.

“For years, people were just like: ‘Hey, big guy!’ And I was like, I am the big guy, aren’t I?” says Smith. “Nobody ever says: ‘Hey, fat-ass!’”

At his heaviest, Smith, who is 5ft 9in, weighed 23st 8lb (150kg). About a decade ago he was escorted off a plane for being unable to squeeze into one seat. The story made headlines around the world, and internet trolls were merciless. For the first time, Smith felt naked. “Suddenly, I was like: ‘They know I’m fat’ – I thought I was hiding it!”

For a while, he swaggered through his insecurities, titling that year’s live show Too Fat for 40, then launching the podcast Fat Man on Batman and publishing a memoir called Tough Sh*t: Life Advice from a Fat, Lazy Slob Who Did Good. But he also quit sugar, an experience he likens to withdrawing from heroin.

Finally, the craving for desserts stopped and 5st melted away. An hour before his heart attack, Smith had been boasting on stage about dropping five underwear sizes from 5XL to XL.

“I would have thought I was in pretty decent shape that night,” he says. “But now it’s weird to look at me and go: ‘Jesus, did I know I was that unhealthy? Or did I just not care?’”

Since then, he has lost almost another 6st by going vegan, at the insistence of his 20-year-old daughter, Harley Quinn. Most days, he fasts until noon, then grabs vegan nachos from his favourite fast food joint. He has stocked a two-foot-wide snack bowl with crunchy chickpeas and vegetable puffs in case he gets the munchies. “Treats galore!” he grins.

Now his wedding ring wobbles when Smith waves his hands.. The first time he realised he was too skinny for the Big and Tall clothing store, he nearly cried. His purple sports coat droops on his shoulders, but he worries that if he has it taken in to fit his new frame, he will jinx himself and regain the weight he has lost. Part of him still can’t help crediting luck over effort. He did, however, give away all his signature hockey jerseys. “I started looking weird in them,” says Smith. Although, he adds: “People were like: ‘You looked weird the whole time.’”

Jason Lee, Jason Mewes and Kevin Smith in the 2001 film Jay and Silent Bob Strike Back. Photograph: Allstar/View Askew Productions

This year has been surreal. Smith posed for a photo shoot for Men’s Health magazine. “Somebody told me online: ‘You’re like a Walmart Robert Downey Jr,’” says Smith. “I’ll take that!” A website stole his picture to hawk diet pills.

Last month, he and Mewes were invited to put their handprints in the cement outside the legendary Grauman’s Chinese Theatre on Hollywood Boulevard. Smith brought his father’s ashes to the ceremony. Four decades ago, on a family vacation, his dad had offhandedly told him he might be here some day. Now he was. Smith ground an urn print into the wet pavement.

In his new film, Jay & Silent Bob Reboot, Jay and Silent Bob are still where he left them in 2006’s Clerks 2, loitering outside the Quick Stop, although the video rental shop next to the Quick Stop has been supplanted by a Redbox kiosk. “The world has moved on,” says Smith. As for Jay and Silent Bob, now visibly in their 40s, they are out-of-touch apolitical white males. “We needed to introduce them to ‘this is woke culture’.”

Smith chose the one-year anniversary of his heart attack for his first day of filming. “It’s not macabre,” he chuckles, “It’s a ‘fuck you’ to death!” The movie finds the pair trekking, again, from New Jersey to California to fight for the film rights for their fictional likenesses Bluntman and Chronic, as they did in 2001’s Jay and Silent Bob Strike Back.

The script is a greatest hits of inside jokes. Smith settled on calling it a reboot, which one character explains, is when “they take a flick you loved as a kid and add youth and diversity to it”. That is exactly what Smith has done, recasting the film with a pro-LGBTQ anti-Nazi and hiring Harley Quinn to play the leader of a pack of rebellious vegan girls.

Smith at home in Los Angeles Photograph: Jessica Pons/The Guardian

“This is the most bloated and self-indulgent movie anyone’s ever made, and I might get away with it because of the heart attack,” he laughs. As for his star-studded cast, which includes Damon and Affleck, plus Chris Hemsworth, Rosario Dawson, Fred Armisen, Craig Robinson, Val Kilmer, Tommy Chong and rappers Method Man and Redman, he jokes that, apart from Affleck, most of them probably showed up out of guilt. “Affleck was like: ‘I didn’t even know about the heart attack.’” Smith pauses. “I don’t know how I feel about that.”

Smith doesn’t agree with the Joker director Todd Phillips’ insistence that woke culture has destroyed comedy. “I don’t feel that way because I always punch in,” he says. Jokes that punch down are “just boring”. But as he is punching in, the tenderest bruise is why he has not tried harder to direct serious comic book movies when he is famous for taking comic books seriously. The other film-makers in his indie clique – Tarantino, Rodriguez and Richard Linklater – made good-looking movies when they won bigger budgets. “Whereas me, I could do cheap, and then people gave me real money and they’re like: ‘It looks cheap.’

“Every once in a while, I wonder if I should have done better?” he says. “If you just concentrated on the thing that brought you into the conversation, directing, would you be better now?”

The indie wave he helped to inspire has become a tsunami. “If I started my career now, you might not hear about me,” Smith says. “I couldn’t break through this noise.” To sell tickets to Jay & Silent Bob Reboot, Smith will tour with the film for five months offering audiences a post-screening chat that tends to climax to an inspirational sermon about how if he made it, anyone can. His biography – not his films – is becoming his legacy.

“Maybe I’ll just become one with the art where Kevin Smith is no longer an individual, he’s just a concept of these series of movies. Until people are like, ‘Who is Kevin Smith?’ because they don’t watch movies any more – but that’s what the handprints are about.”

The weed he has been smoking during the interview has definitely kicked in. Yet he sees his career with clarity.

“I don’t think I’m a film-maker,” says Smith. “I think I’m a salesman. I could sell you Kevin Smith all day. Not a lot of people are buying any more, but enough are where I still get to do this.”

Two years ago, he got a call from the man who launched his fame: Weinstein. They hadn’t spoken for about 10 years, after falling out over the marketing for their final film together, Zack and Miri Make a Porno. Weinstein suggested they partner on a sequel to Dogma. Smith was thrilled. “Hopefully people understand, but getting that call meant the world. I felt like: ‘Oh, he remembered me.’”

A week later, the first article about Weinstein’s sexual assaults broke. “All I knew was that he was a philanderer, he cheated on his wife,” says Smith. Of course, he realised that Weinstein didn’t care about Dogma, or him.

“He was circling his wagons,” says Smith. “I am not a victim here. But I felt used a little bit.” Days later, to help the real victims – the women whose dreams Weinstein crushed – Smith pledged his future residuals from the films Weinstein produced to the non-profit Women in Film.

“If you’d gone back in time and told that kid: ‘This is all you’ll do, but it will be connected to a person who does all of this to all these people,’ I definitely wouldn’t have done it,” says Smith. “I was way too Christian.” Smith is no longer religious (Dogma, he claims, revoked his invitation to heaven), but he still seems guided by guilt, obligation and gratitude. “Career-wise, I always felt like I was playing on house money,” says Smith. “Now life-wise, this is just a bonus because it was supposed to end in that emergency room.”

To him, his own Clerks catchphrase – “I’m not even supposed to be here today” – now echoes even louder. “Let’s be honest,” says Smith. “We’re all insanely lucky to be here. I’m just insanely lucky I get to stick around a little longer.”

Jay & Silent Bob Reboot is out on 29 November