It's hard to find out what causes not sleeping throughout the night. Personally I had to:
- Cut out food and drink 6 hours before bedtime (even limiting water). This minimized my body waking me up for many digestive/expulsion issues. Now 3 hours before bedtime is enough.
- Read novels with vocalization in your head that aren't too exciting one hour before bedtime. The reading slowed my thinking and minimized waking up with racing thoughts. I now need 15-30 minutes of reading to fall asleep.
- Took 2 months of applying this daily before I could sleep through the night.
Good luck finding out what helps you!