Call it the Murphy’s Law of writing. It’s very common and, at times, very frustrating.
To overcome this, you might consider keeping a notebook (or file in on your desktop) where you jot down the ideas as they come to you. You may want to divide your book in sections using colorful tabs — with categories such as ideas for book plots, character studies, nonfiction writing topics, interesting tidbits that might make a good story (you can decide what topics work best for you and what you are writing).
When you find yourself staring at the blank screen and unsure of your next project, go ahead and spend a few minutes looking over your idea book. You may find nothing that speaks to you at that moment. On the other hand, you may just get an idea for the next great novel.