This question has never really come to mind before.
Come to think of it, ideas come when I am out simply doing something completely different such as having a walk, working out and cooking.
I write down the notes on my notes app.
Later I do the research and start the work on it.