How do you ensure that all your characters speak in a distinctive 'voice'?
I go by their upbringing, education level and place of origin. There are a lot of different little things you can do to make distinguish their voices, as well as show a little bit of background for people who relate, or are a little more "worldly" without having to actually explain anything. It's actually one of the more fun parts about character creation, there is so much you can do to develop a character through the speech patterns and use of words.
My character Julian originally only knew Russian (to an extent), while they use word shortcuts (they're, you're, aren't) for the most part they speak a little more properly... minus the profanity. Although occasionally they'll lose their cool, showing an accent or mixing Russian with English. Julian is also extremely technical and self-deprecating, so I try to make their speech reflect that.
Apollo is from a super small redneck town in Ohio and has a bit of a hick accent, which gets absolutely incoherent and unreadable when he's trashed. How he talks is pretty much 100% based off the people I talked to, and the family I stayed with when I lived in Newark, Ohio for a couple years.
I also have some small differences for side characters, but I don't put as much work into them since they don't have very large rolls in the story. Although one of my side character's family immigrated from Mexico, and later on in the story he switches between Spanish and English. Although he doesn't have much of an accent since he grew up learning both languages fluently.
What makes 'bad dialogue'?
Bad dialogue is probably when all the characters talk the exact same way, or when it sounds very unnatural like those anime where a character is spewing out exposition for no good reason. Anime is actually a pretty go example for a lot of bad dialogue choices, or at least choices that may not make sense outside of the Japanese culture. Such as when characters call eachother by their formal roles (big/little brother, big/little sister, mother, father, etc.) when talking to them or calling them, rather than using their names, or using more casual forms of the words.
Sometimes bad dialogue is part of what makes a great experience, though. I don't think movies like Trolls 2, Birdemic and The Room would be as amazing if they had good dialogue scenes. The unnatural sentence structures and character interactions are part of the charm.
How do you balance dialogue with other elements of your work?
I couple it with the appropriate body language, interactions, setting and events. While I try to make as much of my dialogue as I can have some kind of purpose to the story, I also try to make it fit with whatever is happening in a scene, as well as work with whoever is delivering it.