Perhaps one of the most influential and beloved writers of the 21st century, it may be surprising to hear that the mind behind the world of Harry Potter has also suffered from depression. J.K. Rowling was first hit by depression when her two-year marriage to a television journalist fell apart. Rowling had moved to Portugal to teach English and, while she was there, gave birth to her first daughter Jessica. When her marriage ended, J.K. Rowling decided to move back to Britain to rebuild a life for her daughter.
At that point in Rowling's life, everything seemed like a whirlwind and adrenaline was what kept her going. But when the dust finally settled, she realized "what a complete mess [she] had made of [her] life." The realization hit her hard, and Rowling became clinically depressed, gripped "by a numbness, a coldness and an inability to believe you will feel happy again. All the color drained out of life." Rowling even became so convinced everything in life was going wrong that she thought something terrible was going to happen to two-year-old Jessica. She explained, "It was almost a surprise to me every morning that [Jessica] was still alive. I kept expecting her to die. It was a bad, bad time."
For many readers, it may be a shock to learn that throughout the writing process of Harry Potter and the Sorcerer's Stone, Rowling was suffering from depression. But as she sat down and put her pencil to the paper, J.K. Rowling began to turn her life around. "I just thought I want to write so I wrote the book. What was the worst that could happen? It could get turned down by every publisher in Britain. Big deal."

http://thecreativemind.net/3107/jk-rowling-on-writing-and-depression/
As with many cases, I think that it is so important for those suffering with depression to have and set goals in their life. It is also vital to find something that you truly love doing and devote your life to that. If you, for example, know that writing brings you great joy like J.K. Rowling, then write a bit every day. Knowing that your life has purpose and small things can bring joy may provide some comfort for those suffering from depression.