How a character speaks—diction—can be just as important as what he or she says. It''s important that you craft dialogue that is consistent with the characters you have created—that you speak in a character''s voice, always, but most especially when you are in that character''s POV, when "voice" extends to anything—speech, thoughts, descriptions—presented by that character.
One way to give a character a distinct voice is through dialect or accented speech. Dialect and accents have always presented a particular problem to writers. In the 19th century it was common to lay it on thick. Not so today.
Readers don''t want to have to work to figure out what''s being said; but they still expect us to characterize for them! What''s a careful writer to do? Be, well, careful. A little indication can go a long way. For example, you can simply tell the reader what the accent is, as long as it is one they are likely to recognize:
"How are you, Tom?" Duncan said with his slight Scottish brogue.
Most readers can imagine what a brogue sounds like, and from this point on, they will hold that in mind without your having to throw in dialect or accent heavily. An occasional hint is all you need:
"I always thought you were a fine lass," Duncan said.
The speech of characters who have English as a second language can be indicated by dropping words and varying the order:
"Excuse. Please to tell, how far to ocean?"
Readers can be especially critical when dialect and/or accents are inaccurate or difficult to decipher. Play around with word order. Listen to people who are learning the language. Take notes. Your dialogue will not only be richer, but more easily understood by your readers.