Keep your dialogue tags simple. "Said/says" is what you want 90% of the time, with the occasional "ask/asked." Every once in a while, there might be something else, but you mostly want your dialogue tags to feel invisible. Keep it simple.
Be careful of writing in a dialect (or accent) -- it usually comes off as contrived and trips up the reader.
Try and get into your characters head. The more you are,the easier it is to write for them. And exorcize I like to do before writing for any new characters is write a series of questions, both personal and not, and answer them as your character. It'll give you some practice
Avoid cuss words, or common slang as much as you can. Not for modesty's sake, but because words like that can end up being crutch words which inhibit an opportunity for good writing.
For instance, "That fucking fuck fucked that fuck." while unimaginative, is a grammatically correct sentence.
As much as I am loathe to admit it, for a good example of writing dialogue, at least in modern language, check out the pesterlogs of the popular webcomic Homestuck ([link]). It is entirely dialogue between characters with differing personalities, and you don't need to know the context to pick up on the nuances of their speech (though some are more obvious than others).
If you want to emphasize that a certain character has an accent, write some words out in a deliberately exaggerated fashion. As Badgercheese1994 suggested, try adding accents. Doing this will enrich your story, as I find when a show or movie has even only one foreign person, it has a more refined flow to it, instead of the same nationality, same race, same skin color, etc. As long as they're portrayed in a respectful manner, of course. For example, say you have a character who's imitating a Swedish accent, the dialogue you'd write for him or her will be like:
"Caaaaammmmm aaaaawwwwwnnnn, getcher assignments in on time!" <- I think it would be more engaging to the viewer than simply writing:
The teacher told her students in a thick Swedish accent, "Come on, get your assignments in on time!"
I mean absolutely no disrespect for Swedish people. I simply used the Swedish example, mostly because I couldn't think of another accent to ustilize.
However, in general, listen to foreign people's accents. Or, if you don't wish to use foreigners, or you fear there are too many, try to balance it out with an important scene with someone who speaks overally well. However, in this scene, their speech is incomprehensible, even by those who are closest to them. Example:
Bob and Alice have broken up. Alice tells everything to her grandmother. Alice is very heartbroken, as Bob cheated on her. Alice cries out loud:
"Graandmhaaahwhwhwa! Bwhaaaahhhb is a jshseerark! Why'd he have to shcrew awup? I trawww- TRAWSTED HIM!" <- Normally, I wouldn't advocate deliberately misspelling words in dialogue. However, I think this is the exception to the rule - while the character is emotional, exaggerate slightly alternate the spelling to match just how upset or excited the character is. Add a few word cuts, such as what I did with "Trust". It'll make it so real, the reader will feel the realism of the emotion.
Here's what Alice is trying to be emotionally strong enough to say in the scene: "Grandma! Bob is a jerk! Why'd he have to screw up? I trusted him!" <- I figure it to be difficult to pass this into the story and make it realistic. The only way one could use this form instead of the other is by describing what is happening to Alice. What are the physical things she's experiencing? What does she feel her heart doing? I find the first example of Alice's dialogue is more appropriate for those who have a hard time intergrating the emotional realism, while this example is more appropriate for when the writer is talented to describe everything that is happening.
I'll be happy to offer more tips or examples, if you wish. I like to help out as much as I can.
Each character should have their own unique voice. Perhaps one character tends to overuse a certain word or phrase, or perhaps another tends to trail off. One could be very flirty and witty, and another could be succinct and blunt.
Your characters should disagree with each other and have different opinions on subjects. This does not mean they need to fight, just that they should each have their own opinions based on their experiences.
Listen to people you know talk to each other, especially those who speak in interesting ways. Keep a notebook with you and jot down some interesting things people say.