Ledger had no previous history of addiction, but had recently separated from his significant other. He had also developed many anxiety and mental issues from his the role as the Joker. These issues started when in order to prepare for the role he locked himself in his apartment for a month.
Ledger could have prevented his overdoes and death by simplify following his doctors prescription. If he had correctly followed his prescription he would still be here today.