One of the things I love most about the writing process is that inspiration can strike at any time. It can come from anywhere or anything; fom overhearing a particular sentence, or from a tv clip, or from going for a walk outside, or even from hearing a song. Sometimes however, even the most creative of writers can get stuck for ideas and suffer from writer's block. Here's what I do when it happens to me:
1. Lie down
I seem to get all my best ideas when I'm lying down, something to do with more blood going to the brain perhaps? I'm not the only one to advocate lying down to generate ideas - in fact Google offices famously have hammocks in to promote creative thinking.
2. Read something
Nothing gets me in a writing mood faster than reading an extract from whatever book I'm currently reading. Surrounding yourself with the words of others really does help to unlock words of your own.
3. Do some free writing
Free writing is the process of just letting yourself scrawl down any words or phrases that come into your head for a designated period of time, say 15 minutes. The words don't have to make sense or be gramatically correct. Just the act of writing, even if its not coherent can get the creative juices flowing again.
4. Work on a different bit
If you're working on a novel or even a short story and you're stuck on a particular section, why not spend some time on a different part? I don't necessarily believe that novels or stories have to be written in a particular order, though some authors might argue it makes the story more consistent if you do. I think that as long as you have some kind of plan and you know where the story is headed, then it's ok to work on something else when you're stuck, and I find that doing so gets me in the frame of mind to tackle the part I'm having difficulty with.
5. Leave it and come back to it
If you've tried all of the above, don't force it. Give yourself some space away from the work [maybe even a few days, unless you're on a deadline] and then come back to it. Sometimes it's easier to find a solution to a problem if you're not in the thick of it.