The legendary fast bowler, 56, took more than 900 international wickets before retiring in 2003.
In a new autobiography, Wasim, 56, said he began using cocaine while working as a television pundit around the world.
“The culture of fame in south Asia is all consuming, seductive and corrupting,” he told the Times.
“You can go to 10 parties a night, and some do. And it took its toll on me.”
His first wife Huma died suddenly in 2009 from a rare fungal infection.
“Huma’s last selfless, unconscious act was curing me of my drug problem,” said Wasim.
“That way of life was over, and I have never looked back.”
After making his international debut in 1984, left-arm quick Wasim played 104 Tests and 356 one-day internationals for Pakistan, winning the 1992 World Cup.
He led Pakistan in 25 Tests and 109 ODIs between 1993 and 2000 and is widely regarded as one of the best bowlers of all time.
Wasim said he “developed a dependence on cocaine” while he was travelling away from Huma and their two sons, who were living in Manchester.
He added: “It started innocuously enough when I was offered a line at a party in England; my use grew steadily more serious, to the point that I felt I needed it to function.
“Huma, I know, was often lonely in this time, she would talk of her desire to move to Karachi, to be nearer her parents and siblings. I was reluctant.
“Why? Partly because I liked going to Karachi on my own, pretending it was work when it was actually about partying, often for days at a time.”
He sought help after his late wife discovered his drug use, but said he had a bad experience in a rehab facility in Lahore and fell back into the habit during the 2009 Champions Trophy, where he worked as a pundit.
He said the drugs were “a substitute for the adrenaline rush of competition, which I sorely missed” but Huma’s death shortly after that tournament spurred him to quit.
He has since remarried and has a young daughter with his second wife.
Wasim also addressed allegations of match-fixing during his career, again denying any involvement in corruption,
In 2000, Pakistan players Saleem Malik and Ata-ur-Rehman were banned for match-fixing.
A report into the scandal by Justice Malik Qayyum found Wasim not guilty of match-fixing but did recommend that he be fined and not allowed to captain Pakistan because he refused to cooperate and “cannot be said to be above suspicion”.
The report said “there has been some evidence to cast doubt on his integrity” but Wasim said he did not read it until he wrote his book.
“I knew I was innocent,” he added.
“Everything was he said, she said, I heard from someone else, Wasim sent a message through someone else. I mean it doesn’t even sound right.
“It’s embarrassing because my kids have grown up and they ask questions.”