Not long before his death, Robin Williams spent time in a Minnesota rehab facility to keep his sobriety in check.

Robin Williams' Fight for Sobriety: His Last Trip to Rehab
The actor quit cocaine and alcohol cold turkey in 1982 and remained sober for 20 years, but fell off the wagon and sought treatment in 2006.

Dr. Drew Pinsky spoke with “Extra” about how closely connected depression is to addiction. Dr. Drew said, “The most significant contributor to depression is the disease of addiction... that is a nefarious complication that makes treatment very difficult.”

Williams also underwent heart surgery in 2009, and Dr. Drew says that can also contribute to depression.

Pinsky explained, “When a person’s chest is opened up, it changes the biology of the heart and the brain in such a way that people usually have severe depressions, and people who already have addiction and depression, it can become an overwhelming problem.”