Go to a place where there are a lot of people and eavesdrop on a conversation.
Write down everything you overhear verbatim. Take note of pauses, slang, hmm-hmms, uh-huhs and any other aspect of the conversation that was important in the way they were conveying what they had to say.
Repeat Steps 1 to 2 as many times as you can with the end result being you have conversations written down for numerous people of varying ethnic groups, class, sex, age, authority and position in life.
Create bios for the characters you're trying to write dialogue for. Make sure you know everything about them from their class, age, race, sex and any other aspect of their life that will determine what they say and how they say it.
Sit down and start writing, taking note of the conversations you've documented and basing the dialogue you write on the biography you wrote for the characters you created.