Read period documents. The best resources for how people talked in a specific era are books from that time. Early English novels, the King James Bible, or the works of Shakespeare will give you a feel for the words people used during the English Renaissance, for example. Charles Dickens or Mark Twain, who wrote in the vernacular, are excellent resources for how people talked in the 19th Century.
Avoid anachronisms. Make sure that you do not use words or expressions that did not exist during the time period. This will be most jarring to the historically learned reader or viewer enjoying your screenplay.
Use common words of the period frequently. When selecting period dialogue for your characters, keep the emphasis on commonly used words of the era. Don't worry about having full mastery of period dialogue. Find a few dozen recurring gems and rely on them to do most of your heavy lifting.
Check historical word meanings. When using words, particularly ones with multiple meanings, check the Oxford English Dictionary to see how the definition has changed over time. Do not use a word for its contemporary meaning. Rather, make sure that your screenplay's period dialogue uses the more archaic definition of the word.
Make the dialogue understandable. While the desire for historical accuracy is admirable, remember that a modern day audience is going to be reading your screenplay and watching the resulting film. Write with accuracy in mind, but also remember to write in a way that the audience can understand.