Sometimes I do this before I begin to write a story. Sometimes I do it when I'm stuck. More often, I do it shortly after I've begun to write my rough draft, when I'm getting a grip on the superficial behavior of my characters and have some idea what I need for them to do.
I interview them.
I do the basics: appearance, place in the story arc, place in the world of the story, relations with other characters.
Then I ask them ten questions. It doesn't matter what the questions are. They can be very basic, dull or even goofy. Then I open my subconscious and let it answer.
I get some interesting results. Sometimes my subconscious messes up and I have to say, "You're lying. That is NOT true for you." Which can also be interesting.
Sometimes my subconscious comes up with stuff that works really well, that I would never have planned. A character in a so-far unpublished book turned out to have poisoned her abusive husband after he caused her to lose her unborn child. It doesn't give you any more sympathy for her subsequent actions, but does give her a dimension she didn't have before. And I never recount the incident--only refer to it, like a pebble dropping into a still pond.
Most of the things I come up with in these interviews stay in the background, and some of it is completely ignored or discarded, but it deepens the characters for me and, best of all, the characters find their voices. I develop how they think and how they talk; their diction and accent and cadence of speech.
And I can cannibalize anything I don't use for another story.
I'm posting to day on my own blog about a related exercise. I hope you'll join me there.