You know more about writing dialogue than you think. After all, you listen to the dialogue of “characters” in your life all the time. You recognize when someone says something “out of character.” You recognize when someone is putting on airs of talking down to you or affecting a false manner of speaking.
As Anne Lamott, author of Bird by Bird, advises, give yourself permission to experience the world as a writer. For example, carry a notebook with you, and write down bits of dialogue, especially if the manner of speech is unlike your own. Later, type your notes (without editing) into a dialogue file. The typing and transposing will engrain into your writerly brain a range of character voices on paper.
In taking my order for breakfast one morning, a waitress mocked the menu by asking, “And how would you like those farm-fresh eggs?” Next she asked, “And what part of the pig would you like this morning?”
I could never hope to make up dialogue that would so economically reveal attitude and personality. I didn’t have to. I paid attention and wrote it down.