Every individual has such thoughts as they daydream. This is called as fantasy thinking. This is not an issue if it is not intefering with your daily routine or your work or your sleep. If it is causing any disturbance then you need to be evaluated for any anxiety symptoms, or insomia or other similar problems.
Next Steps
Try going to bed only when you are ready to sleep.
Avoid large meals before sleep.
Avoid coffee and similar drinks before sleep.
Keep the bedroom dim before sleeping.
Avoid using phone, laptop or Tv just before going to sleep.
Health Tips
If symptoma persist, try consulting a psychiatrist