First time poster here. Hello!
Here's my story thus far: About four weeks ago, two days before my 31st birthday, I started feeling sick, like a cold or sinus infection. A day later, I had read that a classmate of mine had passed away. I hadn't spoken to her since high school and I didn't know her well back then, too, but I felt bad for her. I do remember when I read it, a sudden shockwave went through my body but nothing really came of it.
That is, until I realized that in the two weeks I was battling the cold, I was unable to sleep for more than 3 hours at a time. I'd lie awake, or I'd wake up super early. The lack of sleep caused me to develop some pretty bad headaches. I got over the cold with the fatique and lightheadness but I still had the headaches and insomnia.
A week and a half ago, I saw a doctor and I told him about the possible stress (also I had a new boss at work, classmate's passing) and he prescribed Xanax for me before I go to bed for 30 days, as he thought my stress was just temporary. I tried it but found out quickly that the Xanax would keep me asleep for 4-5 hours and I'd be wide awake again.
Well on Friday instead of Xanax, I tried an over the counter sleeping pill instead. It was the most violent sleep I had ever had as it was like my body kept fighting it on and off all night. On both Saturday and Sunday (yesterday) I realized I started developing anxiety issues from just sitting on my couch. My body's muscles were twitching, my heart raced up a bit and I couldn't concentrate on the TV and in both cases I had to turn back to the Xanax.
I have an appointment scheduled with a doctor today. Is it possible that all of this is temporary or am I in this for life?

I once had heart palpitations for 2 days (6 years ago) and a self-induced stomach cramp for a month a few years ago. But my experience of getting mini-anxiety attacks from just sitting in front of my TV worries me. I'm worried that I won't be able to perform at my job (which I have a really good, decent pay one) and I'm worried that this will ruin my social life. (I'm a single male still looking for his mate.) I tend to stress/worry over things - however, it has never affected me. I wouldn't have even called what's happened in the past month the most stressful time ever - in fact, I had just finished a year of running/weightlifting and felt the best ever physically. Thus I'm baffled as to how/why this came on out of nowhere.
Any kind of assurances/advice would be most welcome.

Also does one usually see a psychologist or psychiatrist first in these new cases?