I'm only really repeating what others have said above, but having lived with anxiety and depression for twelve years now, I've found CBT to really help me to understand that - for anxiety, at least - it's just a cycle of negative thoughts that perpetuate themselves.
I genuinely thought I had lost my mind when I had my first panic attack in 2001, and for maybe six months I lived entirely inside my own head, micro-analysing everything that came into my thoughts and putting a negative spin on it.
I am much better equipped now at recognising when I'm starting to have unhelpful thoughts, and telling them to bugger off. The Steve Peters book mentioned above is worth a read, although it's really only a different way of telling the same story that you'll read if you have some counselling sessions and take away the worksheets.
In my personal experience, I tend to look at anxiety and depression a little like alcoholism; I'll always suffer from the illness, but I can control it and lead the life I want to lead, rather than it controlling me.
Best of luck with getting better.