I get it sometimes too. What I find is best is to clear your mind and do something else, like watch a film, read a book, play a game or listen to music. Sometimes once you've cleared your mind ideas tend to flow better. Even if they don't, you've kept yourself entertained nicely instead.

You can't really control the flow of creative ideas, you just have to take them when they come. If you are bad at remembering your ideas, maybe jotting them down when you think of them will come in handy.