1) If you're talking about working on a side project after spending all day writing code at your day job, try focusing on the things that got you excited about your side project in the first place.
2) Do the fun stuff first. It's easier to keep coding than to start coding, and it's easier to start coding the fun stuff.
3) Write the simplest end-to-end system you can that will work, and then flesh in all the real functionality later. Nothing gets me excited about a project like seeing it Actually Work Right There In Front Of Me.
4) If you're talking about working on the same project all day long, and then working on it some more after hours in front of the screen... take a break! Go run around the block or eat a sandwich or something. Let your brain wander and make connections on its own - if you end up thinking about the project, awesome, but if you don't, that's fine too.
5) Try changing your setting. Go to the local coffee shop or something. Read about Nomadic Programming.
6) Talk about it with a friend. Again, try to focus on the cool stuff and the tricky problems, and let the conversation wander if that's where it goes.
7) Some days it just isn't going to happen. Come back tomorrow. Try not to worry about it too much - sometimes that's just how it goes.