Using slang in your writing can be a good thing. People often don’t speak in proper English so using slang will make your story more real.
But one thing that can jar a reader out of your story is by using slang or speech patterns that are not consistent with your setting. Suppose you were reading a historical novel taking place in 19th-century England, and you come across this line:
“Huh? You aren’t making any sense, Sam.”
Now there is nothing wrong with that line in a modern novel but that was not the manner of speech back in 19th-century England. Anyone reading that line would not believe the characters would speak that way. People during that time spoke more formally. They would not have used the first name of the person they spoke with. A more appropriate line in the story would be:
“I do not believe I know of what you speak, Mr. Watson.”
For many authors, dialogue can be one of the most difficult aspects of writing. You want it to sound authentic and to do so you need to include regional accents and speech patterns. However, if you do so incorrectly, you can ruin your story.
The best advice is always to write about an area you know. But you may want to branch out so spend time studying the dialect of that region. And if you are going to use a particular dialect, make sure you use it consistently. If your character speaks with a heavy southern drawl and suddenly sounds like he is from Boston, your readers are going to notice.
Now in a fictional fantasy world, the inhabitants probably will not use modern-day slang. No one is going to say “awesome.” So as a fantasy writer, I am free to make up my own dialects and slang but have to make sure my reader is going to understand what the characters are saying and of course use any slang consistently throughout the story.
And I can’t mention slang without a brief mention about swearing. This is something that can give a particular flavor to speech – either by its absence or frequency. But again, you need to make sure it is something that is appropriate to your character and setting.
As a fantasy writer, I have often had to come up with some phrase or “swear” word for my characters to say as I felt that the warriors would be more authentic if they swore at least occasionally. In this case, not using swear words would seem odd to my reader. So I had to come up with some words or phrases for them to use in the heat of the moment.
And it isn’t just the slang or dialects that you have to pay attention to. The behavior of our characters needs to be appropriate to the time period or region which you are writing about. Different countries, different races, and even different religions are going to have different standards of what is “normal” regarding how everyone behaves.
These things need to come naturally to your characters and thus need to be natural to you. This means you need to do your research. You need to know the appropriate uses of slang terms. You need to know the customs and behavior of the region and time period you are writing about. Without this research, you are sure to jar you readers out of the story and totally lose your credibility as an author.