SAN FRANCISCO -- In November 2010, Aubrey Huff stood before hundreds of thousands of people outside San Francisco City Hall, reached into his jeans and whipped out the red "rally thong" that was a symbol of the Giants' successful World Series bid.

Two years later, Huff sequestered himself inside a closet at his home, holding a .357 Magnum to his head, and contemplated pulling the trigger to end his misery.

Huff has progressed far beyond that place in the past two years. Though the former Giants first baseman may have appeared thoroughly triumphant when he brandished his lucky underwear following the parade that celebrated San Francisco's first World Series championship, he was already on the path that led him to the brink of suicide.

These days, Huff said in a recent interview with MLB.com, "I'm happy to report that I'm great."

He has found renewed significance in his religious faith, which has helped him overcome clinical depression and anxiety. Huff said he was "thankful" for all that he's endured, "because it woke me up into a new life. I like myself better than I ever have."

Huff, 39, has detailed his struggles in a book, "Baseball Junkie," which is subtitled "The rise, fall and redemption of a World Series champion." The book, which Huff wrote with Stephen Cassar, will be released in February 2017. Readers can also obtain advance copies through a Kickstarter campaign.

"I've learned through this experience that money, material things, success, World Series rings, none of that [stuff] means [anything]," Huff said. "That's not going to buy you happiness. I found out the hard way. I've been humbled, man."

Approximately 40 million Americans have anxiety-related disorders, and 16 million are affected by depression. Worldwide, that number jumps to 350 million. Through "Baseball Junkie," Huff wants others to know that they aren't alone.

"If reading it can save one person's life out there and inspires them with tools to help them through this situation, then I've done my job," Huff said.

Known for his frequent candor during his 2010-12 Giants tenure, Huff tells his tale in a direct, blunt manner. While playing for Baltimore in 2009, he began taking Adderall, a medication for people with Attention Deficit Hyperactivity Disorder that is banned by MLB.

Players are allowed to take Adderall by prescription if they receive approval from physicians for a Therapeutic Use Exemption (TUE) -- a process which, insiders say, is becoming more stringent each year. Without a TUE, players who test positive for Adderall are in violation of baseball's drug policy.

Huff received his introduction to Adderall when he was faced with the prospect of playing a day game following a night game with a hangover.

"Hey, Huffy, this will make you feel better," a teammate suggested, producing the pill.

He was right.

"I had never felt, within 30 minutes, more alive, more energetic, more confident, invincible," Huff said. "I thought, well, [shoot], no wonder so many guys in the league are on that stuff. I went 0-for-4 and I felt like I went 4-for-4. From that moment on I was hooked. ... I was crushing 20, sometimes 50, 60, almost 100 milligrams daily, depending on the pressure of the game," Huff said, adding that he continued "numbing myself" with alcohol on other occasions.

"The bad thing about the Adderall was, it was hard to come off of," Huff explained. "So what it made me do was drink my face off and just pass out every night. The only way I'd feel better the next morning was to pop another [Adderall]. So it was a vicious cycle for three years."

Huff tried to put on a different face publicly.

"You saw me in the clubhouse, walking around in my thong underwear and confident as hell, goofy, funny, great with the media, having fun with you [reporters]," Huff said. "But deep down inside I was a scared little guy, man."

Despite his internal pain, Huff led the 2010 Giants in batting average (.290), home runs (26), RBIs (86), walks (83), on-base percentage (.385) and slugging percentage (.506). While he thrived on the field, he struggled in his relationship with his wife, Baubi.

"I got into a really, really bad place in my marriage," said Huff, who entered a drug and alcohol rehabilitation clinic after the 2010 season.

Huff continued to use Adderall in 2011, when he slumped noticeably (.246 batting average, 12 homers, 59 RBIs, 47 walks, .306 on-base percentage and a .370 slugging percentage). Off the field, Baubi filed for divorce.

Life seemed to improve for Huff in 2012. He and Baubi stayed together, and he decided to quit Adderall and drinking. Then, the night after the infamous April 21 game at New York where he was installed at second base and neglected to cover the bag on a potential double-play grounder, Huff had a panic attack.

"For the first time in a long time, I was playing the game completely sober. No alcohol, no drugs," Huff said. "And I think the pressure of all that just got to me."

Huff awakened in the middle of the night to use the bathroom, and upon returning to bed, his heart began pounding and he felt the hotel-room walls closing in on him.

Huff didn't play again until May 7, by which time he had been prescribed Xanax to treat his anxiety.

"I was a ghost," said Huff, who batted .192 with one home run in 52 games that year.

That was it for Huff's active baseball career. He initially thought that being relieved of the game's stress would ease his anxiety.

But, he said, "It just kept coming. And that turned into a depressive state."

Huff said he's "completely convinced" that his anxiety can be directly attributed to quitting Adderall.

"That's another reason I wrote this book," he said. "I want [other ballplayers] to know that this stuff, as good as it makes you feel, can lead you down a dangerous path."

After that moment in the closet with the gun, Huff said that rediscovering his religious faith -- with considerable encouragement from Baubi -- helped him overcome his anxiety and depression.

"There's no question about it, man," he said. "Sometimes when you get into your darkest hour and you hit rock bottom, the first thing you start reaching for is your faith."

That path led to Huff's continuing efforts to "rewire my mind for positive change," as he said. This includes reading Scripture when he awakens, supplemented on some mornings by a motivational video.

Huff admitted that talking about what he's gone through remains uncomfortable for him. However, he added, sharing his story with others is important for his personal growth. Writing "Baseball Junkie" represents a leap forward.

"I'm not completely out of the woods where I have perfect days. Nobody is," Huff said. "But it's something I've learned to really control and understand. That's how it starts to get better and better every day."

Chris Haft has covered the Giants since 2005, and for MLB.com since 2007. Follow him on Twitter at @sfgiantsbeat and listen to his podcast.