It’s already been said, but… yes, observing people, whether real people or very well-written fictional characters, is the way. Great actors (including voice actors) who bring characters to life are good too.
Goal should be to get to the point where you can “hear those people and their personality in your head” — your friend, your favorite character, a quirky side character, a coworker. Once you can imagine how they’d react and what they would be feeling, dialogue and non-verbal expression comes much more easily. (Maybe unless you have a cognitive atypicality in this area.) For new, original characters, you combine, change, imagine different life circumstances.
Of course then you get to something very difficult: how do you imagine someone’s reaction when it’s affected by some kind of life circumstances and experiences that you have never seen anything like. Sole survivor of a genocide, or something. It’s hard for almost anyone to do “realistically.”