I've always been interested in mental health, and how it interacts with personality. Tackling characters with psychological or mood disorders is tough, but worth the challenge when the result is a much more well rounded, interesting character who works with or works to overcome that aspect of their psyche.
You have to tread carefully, though, if you're going to write characters with mental illness. One of the most frustrating things I see in novels, especially lately, is to have a character be defined completely by whatever mental quirk the author chose to give them. It's like starting out with a Flanderized character. (For the definition of Flanderized, I refer you to TVtropes: Flanderization). If you're going to have a character who is depressed, autistic, has OCD, or some other illness or quirk, don't make that character revolve completely around that aspect. People with mental illnesses have a ton to offer besides just being constantly anxious or neurotic or what have you.
It also helps to have other characters react believably to whatever manifestation of mental illness your character displays. Many people don't understand mental illness, and may act unsympathetic. Others may want to help. Yet others may not even realize there's a problem--and trust me, as someone who used to have ever present anxiety, its shocking how most people will not even notice when you're in the middle of a panic attack at the mall. But the point is, how other characters react and how your character deals with their reactions is a way to flesh out both the mentally ill and the supporting characters.
Last, and this probably goes without saying, but it helps to get mental illness accurate. It can be downright offensive if an author portrays a character as having a certain illness, but nothing about the illness is correct.
It was tough getting Aldric, a soldier with PTSD, to be accurate and well-rounded. It's even tougher now getting Frederick, a stressed and depressed college student facing the real world, accurate. But to do so, it helps not only to know the character but know about the illness they have and how it affects them as a person.