My son sometimes has this sort of anxiety at bedtime. He'll lay in bed for 15 minutes but be convinced he's been up half the night and now he'll be too tired to go to school the next day, etc etc. I mostly just try to give him scenarios to try to think about instead, like designing a fun toy in his head, or counting to a high number in his head. Something to distract him.

We've also had conversations about how it's hard to get rid of a thought by using the whole 'don't think about pink elephants' example. As soon as you try 'not to' think about something it'll loom large in your mind, so you have to think of an alternative instead.