Every human being strives to establish a place in the world, to be seen and accepted in a certain way. Their voice, the way they react to each situation, is developed in an attempt to establish and maintain that place. Their way of speaking, their vocabulary, their boldness or timidity, is shaped by the place they wish to claim and maintain. What they say in a given situation is shaped by the attempt to maintain that position in that situation.
No matter the situation, what we say and do is and attempt to maintain our position, to be seen and treated the way we wish to be seen and treated. In other words, we are all attempting to establish our character in the eyes of our peers.
That is the character's voice: how they maintain, or attempt to maintain, their position in society. Some people, of course, are bad at it, lacking the ability to read the social cues that tell them how people are reacting to them. Other people are unable to attain the position they seek and become hostile to others for not granting them that position. For both these groups, it is still about position.
What we mean when we say that a character acts "out of character" is that they act inconsistently with their usual attempt to establish their position in the group. It often seems easy to resolve a scene by having a character say something, or refrain from speaking, but if their normal attempt to establish their position in the group would result in them saying something else, or speaking rather than remaining silent (or vice versa) it will ring true.
Seeing every conversation as a jockeying or social position, therefore, and clearly understanding how each character wants to be accepted by the group, should lead you to their voice.