The best way I found how to do it is to act them out, aloud.
So while I write, I speak through all dialogue aloud, acting it as if I were acting in a movie, and switching from character to character, changing the tone of my voice, the inflections, even getting up and moving in different ways.
It allows me to inhabit the character completely.
It's also quite funny and adds to the joy of writing (especially all the giggling that comes along with it, and making faces while staring in the mirror).
Whatever method works for you, try it.
It's easy (and it gets your butt out of the chair).
It helps you write better dialogue (and your readers will love you for it).
It's really silly (and I heard somewhere laughter adds years to your life—imagine how many more books you'll be able to write!).