It depends largely on the general style of the prose. There is, of course, the whole translation thing for anything from an early date, another language, or another world, and a writer might use very modern sounding dialogue to make it sound natural and accessible to readers. And that's one way to do it. Some of us, on the other hand, prefer something that may reflect the period we are writing about -- and as readers we would prefer it, too. The other may strike us as lazy, unless it is done very, very well. But attempts at a more period style may come out garbled and even silly if the writer doesn't know the period or how people spoke and is trying to fake it. That can be lazy, too, and often comes across as affected and very much unnatural.
If characters are going to speak naturally, they should speak in a way that is natural to their situation in life. Are they educated in a society where education is a large part of what separates the gentry and the nobility from the working class? What about age? Profession or station in life? All this is about characterization, really. If your character sounds like Bob who works at your local convenience store he's not in character for King Alfred XXIII.
Erikson not withstanding, it makes sense to avoid words that involve concepts that wouldn't exist at the time or in the type of society you've invented for your story. Because, again, it's about characterization: patterns of thought expressed through speech.
Then there are words that used to have different definitions than they do now. Those can grate for some readers. One that I personally hate to see (and do see all too often) is fine, as in "I'm fine" or "He'll be fine." How hard would it be to substitute something like "I wasn't hurt," or "He'll recover soon." These not only don't clash with period usage, but they're more exact, too.
And finally, it's good to take a hard look at any slang you are using. Some of it has been around for a long time and will probably continue to be around for a long time. Some of it, especially the slang that is the very most up-to-date at the time you're writing is likely to grow dated very quickly. In a decade or two or three it may look downright quaint, and not in a good way. It may even look silly. Think about reading a story that was written in the 1950s where the author had all his medieval people might be saying things like "Gosh" and "Golly." The effect on you would probably not be what the author had intended. You might be snickering at moments that were supposed to be serious. So slang should be used carefully.
As, when it comes down to it, is true of every word we use in our writing.