Writers know that they come up against something called Writer's Block. When you just. Can't. Write. Words don't flow, sentences don't make sense, and the story (if you can manage to write) doesn't seem to have any meaning.
Many writers want to know how to solve this. I have read what writers have written about Writer's Block, and this is the answer that seems to be repeated, over and over again.
Force yourself to write, to put fingers to keys, or pencil to paper, or even feather pen to papyrus.
If you can't manage to work on your main project, go and write something else. Try something different. If you've never written contemporary fiction, try it. If you're an all-out science fiction/science fantasy junkie, try picking up a sword or bow and venturing into the dangerous realms of medieval fantasy. You don't have to stick with the same thing.
(This is not to say that you shouldn't do things other than write, but ultimately, the only way to write is to write.)