How to deal with anxiety and depression after being kicked out of PhD program? I was kicked out of a programming-oriented PhD program at the end of last summer because I failed one of two qualifying exams; the department is keeping me on assistantship for a semester while I finish a master's thesis (which I've done).

Now over the past few months, I have developed a strong depression and even feel suicidal. I feel that I've been given many great opportunities and squandered them.  Applying to jobs in my field didn’t work out either due to lack of interest from the prospective employer or the employer getting a negative impression from my interview.

I've had many jobs throughout my life, and without exception I have struggled and usually failed due to extreme anxiety.  Honestly, I don't even know if I would want a job even if I was offered one, because I feel that I would waste the employer's time and cause myself greater suffering, and ultimately fail.

How can I deal with these issues?

EDIT:  Thank you all for your kind advice and support; for any of those interested, I'm on a more even keel now than I was when I wrote this question, and I have taken steps toward mental recuperation.

I should also say that I won't be checking in on this question anymore, so any further comments are unlikely to reach me.

Thanks.
Seek clinical help! The fact that you are here means that you are someone who believes that you need the help of others and that is very respectable. The problem is that this community, with all the good people in it, is not a good place to provide the help that you can actually benefit from. 

In your question, there are a few points that are important. Suicidal thoughts are always serious and must be considered seriously. Failure is not easy to bear and nobody can say that they can have a good time failing their goals but normally, people do not think of self-termination when they fail. If you are having this thought, please seek help. 

Also, you mentioned that you have failed multiple times in your life before. If the number of these failures is a lot, maybe you are suffering from some underlying problem that is inflicting your performance. Conditions like anxiety (as you mentioned), depression, ADHD, ... can have a drastic negative impact on performance and the sad fact is that in many cases, people who suffer are not aware of it. If this is the case for you, look at the bright side of your situation which is the potential of finding the root cause, elimination of which can improve your life dramatically. Again this is something that can only be confirmed with the help of clinical professionals. Please seek help. 

Remember that failure is hard but also remember that even Einstein failed to procure an academic position many times so it happens and it happens to everyone. As Churchill once said:


  Success is the ability to go from failure to failure without losing your enthusiasm. 


Give it some time and move on. That is the most important part. 

I repeat myself; please consider the fact that self-termination thoughts should be considered very seriously. Based on your country of residence, conditions may differ but nevertheless, accept the fact that, in any country, there exist people who are trained to provide the type of the help that you can benefit from. Please find them.