Credit: Patrick McCarthy

There were days when Stephon Marbury wasn’t sure he wanted to keep going, days so dark that he did little more than lie in bed, watch television and eat bowls of Fruity Pebbles.

He had fought with one coach too many and his basketball career looked dead. The Knicks, the franchise he grew up loving, had banned him from the team. A newspaper he had grown up reading had labeled him the “most reviled” player in New York. His shoe company had gone down the tubes when the store that carried it went out of business. And, most painfully, his father, Don, had died after suffering a heart attack at a Knicks game, and his mother had health problems.

“I was depressed. I was in a bad state,” Marbury said Wednesday while talking about how his NBA career ended seven years ago. “It was a really tough time, but I think it’s something I had to go through to get to where I am today.”

Today, the 40-year-old Marbury is one of the most popular basketball players on the planet, having led the Beijing Ducks to three national championships. He is so popular in Beijing that he has been featured on a postage stamp, has his own statue in the city and his own museum just a few blocks away from Tiananmen Square.

A theater company made a musical of his life called “I Am Marbury” in 2014, and he played the starring role. He recently won Best New Actors honors at the Shanghai Film Festival for his bio-pic, “My Other Home,” about moving to China. The film, which also features former NBA stars Baron Davis and Allen Iverson, is scheduled to be released in the United States sometime in the next year.

“I never could have imagined my life would go like this,” Marbury said before speaking to a group of freshmen at NYU. “It’s unbelievable, but it’s my story.”

As inspirational figures go, Marbury is flawed and complicated. There were times in his NBA career when he was far from a role model, on and off the court. Yet his perseverance and ability to think outside the box is a good message to send to students taking their first steps toward adulthood.

Life at 40 is often not what you thought it would be when you were younger. Sometimes you end up taking a different path than the one you thought you would take. Marbury signed with his first Chinese team in 2010, basically because he had no other options after turning down an offer from the Celtics for the league minimum.

“I remember when I was flying over there for the first time and thinking ‘Why am I flying halfway across the world to play basketball?’ ” Marbury said. “But when I got there and got off the plane, there were like 4,000 people at the airport to greet me. They were going crazy.”

Marbury played for two Chinese teams before signing with Beijing, where he became an instant superstar. He has since been able to come to terms with everything that happened during his years in New York, and said he remains a Knicks fan.

When asked if he had empathy for what Carmelo Anthony is going through with the Knicks, considering he also was often blamed for many of the team’s problems, Marbury gave a crooked smile.

“This is New York. This is what happens,” he said. “It’s a cycle. It’s not anything new that’s going on. Somebody has to take the blame. It’s part of being in New York. You gotta come, you gotta ball and you gotta win. If you can’t win, you gotta deal with it. Don’t come to New York if you can’t.”

Marbury splits his time between Beijing and New York. He has relaunched his Starbury athletic shoe and clothing brand. Not a single shoe on sells for more than $50, and a number of them sell for $19.98. He said his connections in China help him produce a high-quality shoe for a reasonable price, a philosophy decidedly foreign in an era in which Lakers rookie Lonzo Ball sells his shoe for $495.

“I’m from the same place where people buy my products,’’ Marbury said. “I’m from Coney Island and the ghetto. I was one of those kids who wished someone did this like me. It’s important to have social responsibility to the community.”

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months