Anyone ever have medicine with side effect of insomnia and got insomnia that way?

I have anxiety and a medicine that I am taking has a side effect of insomnia and I have insomnia now. It has been going on since last Tuesday. I am going to my doctor this afternoon but I only have been using Lunesta for a few days. I tried another medicine he prescribed and It caused me to stay awake with tightness in my chest and I could hear my heart pounding fast and I stopped that one. I can only sleep until I have to get up in the middle of the night and I can't get back to sleep after that. I don't know what to do about it. I was wondering if anyone else has had this happen and what helped you start sleeping normally again.