For those of you who don't know, "Mary Sue" is a term used to describe a flat character. The ideal character is one that comes off the paper. Their personality needs to be believable. Even if you're writing fantasy and your character is a troll, he or she needs to have depth.
Alright, so first things first: the idea for the character.
Here are some ways to get inspired:
People-Watch
Don't be creepy, but just examine the people around you. Observe their actions and mannerisms. How do they speak? Do they seem intelligent? Maybe they're wearing a wedding ring. What is their partner like? Their relationship? The questions you can ask about the person next to you are infinite.
Newspapers
Okay, maybe they're a little out-of-date, but newspapers cover everyday people in interesting situations. What do you think made that man commit that robbery? Maybe he's a single father and has three children to feed. What will happen to him now? What will happen to his kids? You can also get ideas from the obituaries, too. Read what their family thought of them. Oh, so he was a devoted christian and loved children. Maybe you could write about how he came to God, or why he likes kids. Or, for a more twisted twist, maybe his family has him all wrong. Maybe this church-going family man was a crack addict or a murderer who buried his guilt in going to church and caring for children.
Remember: Though the names and maybe situations are real, the characters you invent aren't. It doesn't matter if the person is/was nothing like you imagine. You're just making your own person off of a template that you've been given.
Names
Picture a man named Richard, a man named Thomas, and a man named Elijah. Completely different pictures, right? Just pick up a phonebook and look through. Jen, Aisha, and Monica are totally different pictures in your head. Another way I like to find names is going through old cemeteries. I've always had a taste for older names.
Use Your Existing Characters to Make More
Okay, so you made Richard and he's a murderer that goes to church and likes kids. Which particular kids? Maybe Elijah is his little nephew whose innocence makes Richard believe that maybe everything will be okay. Maybe he can be forgiven. Who's his preacher? His preacher's family? Maybe Richard's preacher, Thomas, is married to a woman named Jen who is the perfect mother to their daughter, Monica, who Richard dotes on.
Do you see what I mean?
I'll post developing characters separately. I don't want a wall of text to be too distracting.