Two things I’ve noticed:
1) For me, they come while I am in the shower, laying down reflecting about the day, taking a walk, praying…Ideas come when I quit consuming.
2) I’m also extremely vigilant about writing ideas down. Good ones, bad ones—it doesn’t matter. If I don’t write it down then it will be lost forever.
[I write everything down using Evernote on my phone but a simple sticky note will do too.]