Having a short-term target to achieve a long-term goal, and not worrying too much about what's in the middle. I decided I needed to do more (screen) writing last year, I was annoyed that I had not written much in the previous few years and was feeling age creeping up on me. But although I've written several short and feature-length screenplays, it had always been an exhausting all-or-nothing process rather than a steady sustainable output.
So I thought to myself that if I only wrote one page a day, I would have 365 pages at the end of a year, which was a lot of material even if it did not assure any single project being complete. One page a day is not a scary target, even if one is feeling creatively empty it's still possible to crank out a page of something bad. So if I really had no ideas I'd pick some random idea like 'car chase' and force myself to just start writing a bout a car chase without worrying about why it was taking place - maybe I would be able to recycle it later for some project that actually required a car chase, or if not at least I would have some experience of how to write that. The key point here was to do some work every day without necessarily having a grand overall vision in one's head of what needs to be done - because you could wait ages for that to come, and the longer you wait the less inspired you feel. So if you're programming and you don't have an idea for your project, you can still find things to do - comment one of your other projects although that's very tedious, or implement quicksort in a language you haven't used before, or whatever. If you're a painter and you don't have an idea for a picture, fill up pages in your sketchbook with studies of your laundry basket or something.
(Incidentally, I also threw a few $ at a new piece of software that had fewer features than my existing word processor but a nicer UI. Don't blame your tools for your problems, but don't use tools you don't like.)
The key point here which took me years to learn, is not to worry about the larger picture. Even if at the end of the year I had 365 one-page fragments that didn't connect together, that in itself would be interesting. Needing a big idea to feel motivated is a trap. You cannot coast along on a wave of intellectual excitement all the time; all waves break and if you rely on the wave then you're like a surfer who can't swim. So on days when you don't have a good idea of what to do, do something shitty.
The first month was horrible. Agonizing. After a couple of weeks I started adapting a short story I liked in order to get some sense of progress and offset the misery of staring into a creative void every time I sat down. That helped, somewhat. Then one day I read something interesting (on HN in fact), jotted down a single sentence about it because it sounded like it would make a good story, and went off to play with the dog. 10 weeks alter, I have the 3rd draft of a feature film. When I got stuck I'd work on the story adaptation I mentioned earlier, and if I got really stuck I'd write commercials for imaginary products and services (some of which will get recycled into a comedy project). Accepting the need to just 'start over' every day has been a big part of that. Even if I wrote 10 pages yesterday, I still have to crank one out today and it might be crap. Oh well.