Will Smith is opening up about a recent dark period in his life.

The actor reveals that he contemplated suicide while filming his upcoming YouTube Originals docuseries, “Will Smith: The Best Shape of My Life,” in which he sets out to lose 20 pounds in 20 weeks after gaining weight during quarantine.

“This began as a journey to get into the best shape of my life,” the King Richard star says in the trailer.

However, he admits the process also took a toll on his mental health. “When I started this show, I thought I was getting into the best shape of my life physically, but mentally I was somewhere else,” he continues. “I ended up discovering a whole lot of hidden things about myself.”

At one point, Smith tells his family that he thought about taking his own life. “That was the only time in my life that I ever considered suicide,” he says as his wife, Jada Pinkett, and three kids, Taj, Jaden, and Willow, look on.

Things got so bad that he even considered quitting the show. However, after many hours in the gym, he was able to transform his body and mind, going from the worst shape to the best shape of his life.

Smith’s six-part unscripted series premieres Nov. 8 on YouTube. He plans to reveal even more in his upcoming memoir. “I’m writing my book and it’s like exposing my life and so many things that people don’t know about me,” he shares.