John Stamos has been open about his struggles with alcohol and being in recovery, and in a new interview with Collider he credits one of his past co-stars with inspiring him to embark on his journey to sobriety.

“I think I was meant to meet Josh Peck,” he said of the former “Drake and Josh” star, with whom he starred in the 2015-’16 Fox sitcom “Grandfathered”.

“Josh Peck was a big inspiration in my recovery,” Stamos admitted.

RELATED: John Stamos Admits ‘Sobriety Helped’ With His Decision To Get Married And Settle Down

“Right around that time, I was going down the wrong path and I had to straighten out. And then, I’m on this show with this guy who was then in recovery for many, many years, playing my son. That part was meant to be,” he added. “I wouldn’t be alive, if I hadn’t straightened up, and he was certainly part of it. So, that’s what I think about with that show.”

In the interview, Stamos also opens up about his disappointment that Fox cancelled the show after just one season.

RELATED: John Stamos Takes Down Omar Navarro And His Complaint About The Gay Character In ‘Cruella’ With A Single Tweet

“I think very simply that it was on the wrong network,” he said. “I was grateful to Fox and, by the way, I’m working with [then-Fox president] Dana Walden now. I remember when that show got canceled. I was in Europe with my then-girlfriend [now wife] Caitlin and they pulled the plug on it. I wrote a scathing email to the president, Dana Walden, who’s a very good friend of mine.”

Luckily, Stamos reconsidered. “I wrote the email, but I did the smart thing and I paused. I thought about it and I waited until the next day, and then I looked at it again and I hit delete.”