Did you ever notice that as you write, you see where a character has to go in order to make the plot work? And did you ever notice that as you write, the plot has to respond to what a character would or would not do? Holy Holistics, Batgirl!
It's bad when a character says or does something inappropriate, something that it's obvious the writer needs in the story at that moment in time. A perfectly nice girl throws a fit in public that in reality would make her never leave home again. An uptight, controlled man suddenly blurts out his true feelings for no apparent reason. Or that old stand-by in detective novels, a character who well knows that someone evil wants to kill him traipses blandly off to a secluded spot for a one-on-one meeting.
An author has to keep in mind at all times who her characters are, but she also can, with a bit of practice, fine tune those characters so they WILL do what she needs them to do. Just a sentence or two early on can prepare the reader to believe that a character is ready to spill his guts or that for the sake of the right person's safety, he might meet bad people in an abandoned warehouse at midnight without backup.
Nothing in fiction is real (Gee, isn't that profound?) We need devices to make a story go forward, and those devices are contrived, sometimes ludicrous. The key is to make them work in the story by combining plot and character so that the reader doesn't mind suspending disbelief. So, yeah, I know that 99 times out of 100 a person won't get up and chase bad guys with a bullet through his shoulder, but I'm willing to let certain private eyes get away with it. The plot has to move, and character makes that, if not a truly entertainable notion, at least a truly entertaining possibility.