Whenever someone asks me that question I'm tempted to tell stories of cabbage leaves and storks. But I won't. Characters and plot both come from the writer's sub-conscience. Writing is like daydreaming that way. Also, like daydreaming, there's no ONE WAY to do it--no rules. Keep in mind that there's only what works for the writer. Myself? Creating characters is one of my favorite things about writing. I enjoy watching them develop and flesh over time. My characters always start out as strangers, but we end as close friends. I usually start with at least one characteristic that is all their own. That characteristic might come from multiple sources. It might be something I noticed about myself or someone else. When I give them characteristics from people I've met I almost never do so in a way they might recognize. (Unless I tell them first. It's too easy to get in trouble.) My characters are always patchwork quilt of my own characteristics and other people's. By the way, I've never created a character based on a real person I disliked and then out of revenge killed them. That's… just not something I'd do. It feels unethical to me.
Anyway, I think it's important to like your characters--even the Black Hats. If the writer cares deeply about their characters, the readers will care. Also, a basic knowledge of psychology helps because it's important to understand people. What motivates a person to behave as they do? What failings do they have? (No one is perfect. And if they're perfect, they're not likely to be very realistic or terribly interesting.) What are their fears? Who do they love? What is important to them? What do they hate? What do they like to eat? Do they have any personality disorders? Beliefs? Oh, and whether or not your character's vision of how the universe works is correct or not isn't what really matters. (Sometimes it's more interesting if their belief is wrong.) Belief move us. We all see ourselves as the hero of the story -- even the evil people.
If you're stuck for ideas, there are fun ways to work through it. You can use character worksheets like the one found in Writing a Breakout Novel Workbook by Donald Maass. Or you can use character sheets from role playing games. I've heard of people using tarot decks, paintings, and photographs as inspiration for creating characters. I use photos and songs. It doesn't matter what you use as long as it works for you.
Three things to keep in mind regarding the creation of a realistic and interesting character:
1) Strong characters tend to be sympathetic in some way.
In my first writing group, they used to call this "petting the dog." That is, the POV character needed to demonstrate to the reader that they are worth their attention. POV characters need to be likeable in some way. There are a lot of options. The writer can use humor (self-deprecating or otherwise) or by helping someone or displaying a positive quality (courage for example) or by doing something with which the reader can relate. Understand, the POV character needs to do this as soon as possible. (I prefer to do it on the first page.) It also needs to feel natural for the character. If you force it, the reader will see right through it.
2) Strong characters have flaws.
What makes the Daniel Craig James Bond so intriguing? It's his humanity. His vulnerability. Mind you, he keeps it hidden, but it's there just beneath the surface, and we know it. We cheer for him because in spite of his weaknesses, he's strong enough to go on. Flaws give characters something internal to struggle against. Flaws add dimension. Think about it. It's our faults that make us human--not our perfection. Perfection seems too robotic or like author wish-fulfillment. Also, mistakes are important. Mistakes are how people learn and grow. We all learn by trial and error. Characters should too. Let them make mistakes--just make sure they're smart mistakes and don't repeat the same ones over and over. That gets old fast.
3) Strong characters have a touch of mystery.
They don't instantly reveal everything about themselves--everything about their past or even their present. Let's face it, no one knows all there is to know about themselves. Sometimes we get it wrong. People change. The element of surprise in a character is pretty wonderful stuff. Used correctly, it can make a beloved character even more interesting. It's best to leave the reader with a few questions about the characters--nothing major to the plot, mind you. Just trust the reader to fill in some of the blanks for themselves. It's the blanks that we fill in for ourselves as readers that make reading an interactive experience.
Characters really are my favorite aspect of writing.