Such a good question, but a big question! 🙂
Some of my favorite authors for dialogue are John Steinbeck, John Green, and Flannery O’Connor, just to name a few off the top of my head. I’d love for others to comment with some authors you find inspire your dialogue.
We could write a whole book about writing distinct character voices (I’m sure there are several good ones), but I think one key is creating distinct characters, in the first place. If you know who your characters are, their language will flow from that. Creating robust, realistic characters will naturally tend towards robust, realistic (and unique) language attributes.
I think the real challenge is to create characters who are distinguishable from each other without making any of them unrealistically weird. Like this guy has a Boston accent, the next guy is Scottish, and the girl has a severe lisp. The better challenge is in making character voices distinct from one another just by using minor vocabulary and sentence structure choices. When it’s done really well, the differences are so minor that the reader couldn’t even articulate what was done, but they do know, intuitively, that they can recognize individual voices.
The Company has a lesson on writing dialogue in the Arche Year series. That’s a good resource too, and elaborates more than this format allows.