Some people have dreams they want to remember or have ideas whilst in bed. It happened a few times to me that an interesting idea came to my mind in bed. Later I remembered that I had an idea but I could not remember the idea itself.
If such things happen to you from time to time the best thing is to have some equipment to write next to your bed. When something comes to your mind you quickly write it down and then you can continue sleeping but remember the next day.
Related articles:

Loading ...
Keeping a notepad next to the bed is an excellent, important, and simple idea. Some of my best brainstorming or “to-do” list additions occurs to me as I am falling asleep or even in the middle of the night.
Another lazy man’s note-taking tool I keep on my bedside table (and when traveling/driving) is a digital voice recorder. They are quite inexpensive and small, and once you are familiar with the location of the “record” button you can quickly leave a memo without needing to turn turn on a light, reach for a pen and paper, or fumble for reading glasses like us “older” guys.
Later when I review my memos, I am more likely to comprehend my voice recording rather than my quickly and sloppily hand-written notes
NOTE PAD CLOSE TO YOUR BED - is also a very good idea. People who have busy life and have problem to do things accurately due to non approach of time may be benefited from this idea. If such things happen to you from time to time the best thing is to have some equipment to write next to your bed. When something comes to your mind you quickly write it down.