In a short story I am writing, I have this misogynistic character who keeps saying misogynistic stuff, and I thought it would be a bad idea to give him dialogue lines. I was thinking that, because I thought the readers might think that I, the writer, is expressing my voice through him even though it's not the case. So how would you do it?
I would use a Foil. From the link:
In fiction, a foil is a character who contrasts with another character, usually the protagonist, to highlight particular qualities of the other character. [...] The word foil comes from the old practice of backing gems with foil to make them shine more brightly.
A foil usually either differs dramatically or is extremely similar but with a key difference setting them apart.
In your case, you need a character that is anti-misogynist. Or to be technical, a philogynist (someone that admires women). This role can also be filled by multiple characters at different times or in different settings. So the misogynist viewpoint is countered, at least occasionally, by the foil.
As far as readers are concerned: Which one are YOU? The misogynist, or the philogynist? Hopefully neither is a straw opponent, so they can't tell. You only run the risk of accusation when you present only one side of the argument (or only one side is presented convincingly).
We all deal frequently with people we disagree with and/or find offensive, so that's not unrealistic to encounter in fiction. But the readers may feel alienated from you, the authorial voice, if they feel you are agreeing with, lionizing, or excusing the behaviors of a negative character.
Here are some questions. Is anyone within the book shown to have a negative view of this person? Does anyone in the book actually confront this person? Is this person presented in a heroic or an antagonistic role? Does the larger narrative support or contradict this character's beliefs? Is the character shown in any significant way to be right or wrong --for instance, and most importantly, are there strong female characters who serve as counter-examples to the misogynistic views?
People aren't going to judge you, the author, on any one character. And you don't have to necessarily beat people over the head with the fact this character is wrong. But if the misogyny of the character is reflected in the larger narrative, that's going to come through loud and clear.
I thought one of the best discussions in film on a topic like this occurred in Jurassic Park, the "Sexism in Survival Situations" scene. In this scene, John Hammond and Ellie Saddler (forgive spelling mistakes) are discussing where the circuit breakers in the park are located and how to turn them back on (and the fact that Samuel L. Jackson is taking his sweet time in actually doing the job). Complicating Matters is the guy in the leather jacket who talks about chaos all the time is injured and one of them needs to stay in the bunker and take care of him.
Hammond begins the moment with him awkwardly trying to explain that he should go into the building with the circuit breaker (that is certainly dangerous) and Saddler should tend to Mr. Chaos (I just recalled the character is Ian Malcolm, but Mr. Chaos is funnier at this point). Now, there are good reasons for this. Hammond owns the property and probably has some passing familiarity with this and Saddler is a biologist (paleo-botany specifically, but it's justified that she can care for wounded as well as Hammond can turn on a power plant.). However, Hammond is also a gentleman of sorts and bungles his offer to go in her stand as a sort of chivalry (who ever goes to turn on the power is likely to get eaten by a dinosaur) and thus he kinda grunts about him being a man and her being a woman (not out of malice mind you). However, it's clear to Saddler that both are equally qualified to do both tasks, Hammond is a Grandfather who has been hobbling around in a movie with a cane, where as Saddler is likely south of 35 at worst and is pretty fit. They can both do the job, but she's much more capable of getting to the job than Hammond.
Here it's clear that if Hammond is a misogynist (and that's a big if... He's clearly operating on "Women and Children (Mr. Chaos)" first mentality, not "Big Strong Man Kill Dinosaur" logic. We're wondering if Samuel L. Jackson is alive at this point after all. If the original Badass Mother- can't do it, it's probably gonna be a luck based mission) then it's clearly not with malice towards Saddler taking the role and isn't bitter about it at all. And Ellie isn't offended by the attempt either... she's more amused and realizes that part of the awkwardness is that Hammond knows what he is asking is stupid, but he's from a time where it was what would be done (a better age where the quintessential British Gentleman would fend off the dinosaurs for a lady. Happened all the time back in Hammond's younger years). She chooses to deliver the scene titling quip, saying they can have the discussion on the topic, after she's back from the dangerous task.