It happens usually in the bed, when all the light is out. This would reduce all stimuli significantly, so you can analyze/use your imagination best. I take a look a some synonyms for "think" but don't know what to choose:
ponder, reflect, deliberate, meditate, contemplate, muse, cogitate, ruminate, be lost in thought, be in a brown study, brood, concentrate, rack one's brains, cudgel one's brains, put on one's thinking cap, sleep on it, cerebrate
My objective is to find an illustration that can describe that state of thinking.