Margera, 37, who is the subject of Wednesday's episode of Epicly Later'd on Viceland
'The Last Stand' film premiere, Los Angeles, America - 14 Jan 2013
Bam Margera
| Credit: Picture Perfect/REX/Shutterstock

Bam Margera is learning to skateboard again after years of alcohol abuse — and he credits the sport with getting his life back on track after hitting rock bottom.

“I took a five year hiatus from skating because I had bone spurs, so instead I was making money by doing nightclub appearances, which basically was shooting photos and taking shots with the locals,” the pro skateboarder and former star of Jackass tells PEOPLE. “So I was s–tbag wasted every night, and eventually was like, ‘This has to stop.’ Once I woke up in my own puke and piss, I knew I had to cut it off.”

But it wasn’t all that easy. Margera, 37, who is the subject of Wednesday’s episode of Epicly Later’d on Viceland, suffered painful injuries on the set of Jackass and had to have foot surgery, which stopped him from skating. He also had to lose the weight he’d gained from drinking heavily for so many years.

“I had to relearn all my tricks,” says Margera, who now lives in Barcelona. “It didn’t help that I was 20 lbs overweight. I had to change my whole diet. Where I used to drink beer or Jack and Coke, it got substituted with water and sit-ups. Once I lost the weight, skating became fun and easy again.”

FROM PEN: Nicole Kidman Opens up about Supporting Keith Urban’s Sobriety

When asked if his Jackass costar Ryan Dunn’s death contributed to the dark days with alcohol abuse, Margera says yes, adding “But then I just reached a point where drinking got really old. I just looked at the big picture, like, “What am I doing? I’m not doing anything, just sitting in a bar in Westchester cracking jokes with he locals. So I stopped.”

He says Spain called to him because natives look at skateboarding as an art form, not just something for kids to do. He adds, “Plus, if I went to any park here, I would get mobbed by all the kids who wanted pictures and autographs. I’m a d— if I say no. So it’s was a no win situation.”

Now, the sober skater is expecting a child with his wife, Nicole Boyd, this winter. “It’ll be fun teaching him to skate,” Margera says of his arriving son, laughing. “But I have mixed feelings about teaching him my stupid Jackass stunts.”

  • Reporting by LIAM BERRY