Try having a notepad & a pen next to your bed. So if you are thinking about something when you are about to fall asleep, write it down. This way you wouldn't feel anxious about it.