Nightmares are caused by an occuring problem, an outlining problem, that you have. The only way to erase them is to find the problem, and either get over it, or fix it.
As for depression, been there man, all the fuckin time. I'm completely out of my mind sometimes, and it takes a lot to get out of that rut. Good luck man, talk to someone. Thats the best thing to do.