I’ve developed insomnia over recent months and regularly wake up, unable to promptly return to sleep. At first, this resulted in my reaching for my iPhone or lying in bed, directionless. Then, I discovered the best thing to do: playing guitar!
Playing guitar while lying in bed works surprisingly well; not being able to see anything results in better listening and fretboard navigation. Furthermore, thinking of music and intently listening is positive thought, better preparing one to return to sleep!
So, if you’re in my situation, try your guitar, it helps more than anything else (at least in my case).