One most common example of this is acting like a teenager. I just turned twenty, so clearly that's way, way behind me now, but it still applies. I think that people's typical first thought about teenagers and young people in general is that they're immature and wild, are concerned with petty things like makeup or the apparent and totally unjust bias of a teacher, and have a care for no one but themselves and their friends. I thought about this even in high school, such as when I was in a car with a friend who had their music turned up loud with their windows down at a stoplight, or with a group of friends who were messing around in a store late at night (doing nothing bad, but probably still being annoying.) I didn't want people to think that I was a part of that, that I was perfectly okay being obnoxious to adults.
This idea leaks into my writing. In writing a story, it's necessary to have characters that are different from yourself (if it's anywhere close to decent, anyway). You need characters that don't agree with you, that have different beliefs and morals and lifestyles. I think writers understand better than most that every person is radically different, because they have to delve into the minds of those people.
So, predictably, I have characters that I don't share beliefs with. Some of my characters have twisted morals, and do dishonest things to get their way. They live their lives the way they want to, and a lot of the time, they seem just fine, as if what they do isn't wrong at all. And I have to write these characters, showing the story from their point of view. The events of the story are colored with their perspective, however skewed it may be.
It's difficult for me to go all out with these characters. What if readers think I agree with what my characters do? What if they think I'm okay with what's going on? What if they think that I put a character in my story because I want to support my own perspective through them? What if they judge me for including some not-so-great things?
When I'm writing uncomfortable scenes, I often have the urge to include a disclaimer in parentheses:
"He tossed the shot of vodka down his throat. Man, it felt good to get drunk again. (But it's not good to get drunk, guys. You might do things you regret, okay? I don't like that he's doing this.)
She felt a rush of excitement as she watched him refill his glass. Once he was drunk enough, she would make her move. She had always wanted to make out with him, and this was her chance. (See what I mean? Maybe he doesn't want to get involved with her, but he's going to since he's drunk! And don't make out with random people either, everyone. That's stupid.)"
Interrupts the flow of the story a little bit, right? But how else are the readers supposed to know that I don't condone that behavior?
In theory, that's an easy question to answer: authors don't express their beliefs through their characters, but through the themes of their writing.
I'm not saying that a writer would never have a character that is similar to them in terms of ideology, behavior, etc., but if you want to get inside the writer's head, look at what results their characters are producing through their words and actions. How does the story end? What happens to those characters?
All of this is especially pertinent to Christian authors, but that discussion is for another day.