I faced the same problem many times. Especially when I had to find mathematical solutions to hard problems, or when I had to find some algorithms.
In the first place, it might be hard to get over the first idea. However, I usually make long walks outdoor, preferably to places I've never been before. Because I noticed a curious fact. Everytime, I am at the same place, I tend to have the same thoughts. Thoughts seem to be associated to places. And I think this is the mental trick behind many people with super memories. They arrange the objects to remember along an imaginary path, they walk mentally.
I use walks into unknown areas to allow my brain having different thoughts.
Before doing so, I like to forget the problem and listening to music, watching movies, playing some games to gather some inspirations. Also surfing the WWW without fixed goal can be very inspirative.