I can relate because I've had really serious insomnia issues - not so bad now, but about a year ago night after night up until 2 or later.
Since you are waking up repeatedly, and it happens often, I would recommend, if you have health insurance, seeing a sleep specialist. There may be a physical problem. Try to get a recommendation from a primary care doc since this is a field that has a lot of quacks in it. You may have sleep apnea. In apnea, your breathing stops long enough for your body to react. The physiological reaction is a surge of adrenaline, which makes you gasp and increases heart rate, getting breathing going. While adrenaline is great if you're running from a wild tiger, if you're trying to rest repeated adrenaline surges can result in anxiety or even panic attacks.
My breathing was obstructed and every time I started to doze (which makes muscles relax) I was not getting enough air, so I'd jerk awake in panic. Then when I fell asleep kept waking over and over. I can easily see how sleep deprivation is a torture technique; I would have done damn near anything to just be able to sleep.
One thing the sleep specialist told me that was helpful. Insomnia is miserable but you will NOT die. You will be tired. That's all. Because at 2 AM you are clearly worrying about what will happen if you don't sleep.
Just a note to be careful about taking other people's prescription meds. I took a trazadone from a friend and it made my condition worse.
If the usual relaxation techniques, many described here, exercise during the day, no food late, warm bath, etc don't work, do try medical assessment.