Newton did it lounging under an apple tree. Archimedes did it soaking in a bathtub. Einstein did it while shaving. Those are the settings in which these great minds did their best thinking (at least according to legend). The common theme is that they were in the state of relaxed concentration. Rather than sit at your desk hammering away at a problem, it is often wise to let your mind wander. In his terrific book The Element Sir Ken Robinson describes the process:
There is far more to our minds than the deliberate processes of conscious thought. Beneath the noisy surface of our minds, there are deep reserves of memory and association, of feelings and perceptions that process and record our life's experiences beyond our conscious awareness. So at times, creativity is a conscious effort. At others, we need to let our ideas ferment for awhile and trust the deeper unconscious ruminations in our minds, over which we have less control. Sometimes when we do, the insights we've been searching for will come to us in a rush, like "letting a cork out of a bottle."
It is widely known that many people have their ideas in the shower. Some people keep a notebook on their nightstand because inspiration strikes in the middle of the night. Others might find that ideas hit them when they are sitting in a movie theater. Personally, I find that I make most of my connections when reading for pleasure.
So, when and where do you have your best ideas?