On his visionary debut album, 2009’s “Man on the Moon: The End of Day,” Kid Cudi opened up about his “Pursuit of Happiness.” But after years of battling depression, anxiety and drug abuse, the influential rapper-singer found himself in such a dark place that he was contemplating suicide in 2016.

“I had just started using [cocaine] again, not happy with myself that I allowed myself to go back to that after all these years,” Cudi says in the new Amazon Prime documentary “A Man Named Scott,” premiering Friday. “I was just really ashamed. I was suicidal, and I was at a place where I was trying to plan it. And I knew that if I didn’t go get help, that something woulda happened … I just had to get my s – – t together.”

Shia LaBeouf, Kanye West and Timothée Chalamet are interviewed in the new Kid Cudi documentary “A Man Named Scott.”
Kid Cudi’s “A Man Named Scott” documentary premieres on Amazon Prime Friday.

‘The cocaine s – – t scared me deeply. When he started doing it, I couldn’t talk to him no more, like, I couldn’t get to him no more.’

And in an emotional Facebook post Oct. 4, 2016, Cudi — whose real name is Scott Mescudi — revealed that he checked himself into rehab. But it was a long journey to recovery for this 37-year-old artist, whose emo hip-hop has inspired everyone from his longtime collaborator Kanye West and A$AP Rocky to actors Timothée Chalamet and Shia LaBeouf — all of whom are interviewed in “A Man Named Scott.”

After the breakout success of “Man on the Moon” — which also featured the hit “Day ’n’ Nite” — Cudi struggled with his newfound fame. “I just really found it hard to be happy,” he says in the doc. “I accomplished what I came to New York City to accomplish, but I was miserable, man … There would be some nights where I’d be at the club, and I would just run out the club and run for blocks, and I would hop in a yellow cab trying to get away from my security.”

Longtime Kid Cudi collaborator Kanye West is featured in the new documentary “A Man Named Scott.”

Along the way “from being Scott to being Kid Cudi,” he got lost. “It was a little bit of a nightmare for me, because I wasn’t right with myself,” says Cudi. “When I would do shows, I didn’t feel anything.”

Cudi used cocaine to cope with the anxiety that came with finding stardom and losing his privacy. “[Interviewers] would be like, ‘Oh, when you lost your dad at 11 years old, what was that like?’ ” he says. “And I would do interviews with sunglasses on, and I’d be on cocaine, and I’d just be, like, sitting there answering these questions, ’cause that’s the only way I could talk about stuff like that.”

Kid Cudi discusses his battles with depression, anxiety and drug abuse in “A Man Named Scott.”
Courtesy of Amazon Studios

After getting arrested in New York in 2010 on charges of criminal mischief and possession of a controlled substance, Cudi had a wake-up call. “I remember I got out of jail, and I was ashamed because I grew up with two uncles that were addicted to crack,” he says. “But I’m glad I got arrested, because that’s when I quit. I don’t think I woulda quit if people didn’t find out about it.”

Still, he couldn’t shake all of his demons, and in 2015, he even sang about killing himself on his single “Confused!” Feeling “empty inside,” Cudi relapsed on cocaine.

“People look up to me, but I’m not a happy person, so a lot of the times I felt like a fraud,” he says, “and that’s what drove me to the dark side.”

Kid Cudi shares how he went to rehab after having suicidal urges in “A Man Named Scott.”
Courtesy of Amazon Studios

Cudi even drove away his BFF LaBeouf. “The cocaine s – – t scared me deeply,” says LaBeouf. “When he started doing it, I couldn’t talk to him no more, like, I couldn’t get to him no more. He started getting isolated, he wouldn’t respond.”

But after finally facing “my bulls – – t” in rehab, Cudi says, “I’m in such a happier place … And knowing that I’m at a better place with me, with Scott, that I love myself, that I’m happy, I just hope fans can see that.”

If you are struggling with suicidal thoughts or are experiencing a mental health crisis, call the 24/7 National Suicide Prevention hotline at 1-800-273-8255 or go to SuicidePreventionLifeline.org.