I'm writing a book and I'd really love to include a person with they/them pronouns. However, the novel takes place in a sort of medieval style fantasy world, and I don't think anyone would have used they/them pronouns in that time period. Am I still able to use they/them or is there something else I should do that fits the time period? Or am I just not able to include them at all?
Realism is just a style, and accuracy is just a technique --meaning, you should do what best serves your story. There are historical pieces --the current Hulu series The Great is a prime example, and the classic fantasy novel The Once and Future King is another --that are presented in a contemporary style, and where the illusion of historical accuracy is not important to the story being told.
On the other hand there are pieces where historical accuracy are expected or demanded --although the irony here is that things that are authentically historical may seem anachronistic if they don't match the reader's preconceptions. Historical societies were often actually MORE diverse than they are typically portrayed. For example, if you depicted black citizens in Ancient Rome you might be accused of political correct tokenism. But the historical fact is that there WERE black citizens in some times and places of the Roman Empire.
Using "they/them" will tend to make your piece seem more contemporary, because that's a relatively recent convention in modern English, one that still is not universally accepted. But this is your fantasy world, and if you want there to be a recognized place in it for non-binary people (and language to match), all you have to do is imagine it.
Sure you can. But, you have to make it fit into your world.
You have two basic options here:
Make your society tolerant of your character's gender. Quasi-medieval doesn't have to mean precisely medieval, most fantasy worlds have some fairly drastic differences from medieval times (among others, most of them don't have the Catholic Church around - that's already a huge change.) Never to mention what the addition of magic would do to society. Viewed that way, having the world be a little more flexible re: gender than medieval times is just one change among many.
However, if you go this route, you have to make sure to set out the limits of this and make it make sense in your society. If there's a third gender around, what does that mean for gender roles? Cultural norms around marriage? Typical family structure? The legalities of inheritance? Is the overall society just more flexible as far as gender is concerned, or is it that in addition to "male" and "female" there's a specific third gender with a clearly defined societal role? (As has been the case in multiple cultures, although medieval European isn't one unless you count eunuchs). And how does your character fit into all this?
In short: worldbuilding is an absolute must if you don't want this to feel incoherent and tacked on.
Making your world intolerant, but writing a nonbinary character anyway. Trans people have existed throughout history. They've existed, and done their best to live the life they wanted, even in societies that were not at all open to the idea. (Obligatory wiki link: the Public Universal Friend is a fun example from the 18th century. Not medieval, but not exactly a trans-friendly time nonetheless.) So... just because the world around them doesn't want them to won't necessarily stop your character from going by a gender-neutral pronoun or trying to present in an ambiguous way.
If you go this route, though, you're going to have to be ready to write serious levels of prejudice. Confusion, rejection and hostility may be the order of the day. They may be ostracized, may face persecution. They may even run into difficulties with the law – "pretending" to be a gender other than the one they were assigned at birth may be illegal. They're probably going to have to constantly weigh their own safety vs living the life they want to and make some hard choices. You don't have to go entirely doom and gloom – it's quite possible your character develops a circle of tolerant friends, for instance – but, again, to some extent you need to put your money where your mouth is in order for this to seem plausible.
Given that you've done the above and have a nonbinary person in your quasi-medieval world, I don't see a problem with using specifically singular they. For one, you're writing in modern English, some amount of translation can be assumed. For another, singular they has been used as a gender-neutral/non-gender-specific pronoun since the 14th century, so it's not exactly anachronistic.
How fantastic is this world? Is it basically historical fantasy (i.e. it's earth unless otherwise noted differently) OR is it another earth like planet in a medievel plot?
I will say that the use of modern tolerance standards centuries ahead of modern standards pulls me out of the story a bit. I can accept dragons flying around England, but not a medievel European society being more tolerant of two men kissing openly in public than not... and I'm in a homosexual relationship. That's just me though. I will say that the they/them third person singular usage is very very recent in English and would only exist as a third person plural (I'll wave aside that Old English is almost linguistically distinct from Modern English... language evolves with time this isn't just an English issue).
The word "Tomboy" was first recorded in the 1500s to describe a person who was a girl but enjoyed typically male gender role activities over female gender role activities. People matching this description would still use the female third person singular pronouns (she/her) though would see being called a "girl" as insulting especially when used in a Sandlot manner ("You play ball like a girl" being the most offensive thing to said to the protaganists, cementing the stakes of the following competion... the humor in the scene was that there way worse things said to them and they gave as good as they got... this line was rather tame in comparioson but their response is that it's an unforgiveable insult). The medical and psychological sciences would not have existed to make a non-binary gender character period plausible.
That said, this is fantasy and it's not a reason to shy away, depending on how fantastic it is. Perhaps your Elves do not identify as male/female because the Elvish Language does not have linguistic genders. Thus an elf that speaks English may not fully understand gender (despite having a sex i.e. a bilogical gender) and struggle with identifying as a He when the Elf doesn't get the concept (this is actually a translation problem, as English is a gendered language, but it uses gender pretty much in line with sex for nouns, where as German does not ("The Turnip" is male, while "The Girl" is neutral) and most Romance Languages use it to denote sentance structure AND thus it's vitally important to know the gender syntaxes in order to parse the sentance order (Latin, and thus langugaes that descend from it, don't have a typical order in sentance sturcture, so gender ties adgectives to nouns as well as the subject or object of a sentance. Germanic Languages like German and English seperate all subject modifiers and nouns from the Predicate modifiers and nouns by the verb. Usually it's Subject Verb Predicate order, but Yoda speak of Predicate Verb Subject is acceptable as well.). If you don't want to fall into the trap of Effeminant Elves having no gendered language in Elvish, go with the hilarious twist that Dwarves have no concept of Gender in Dwarven Languages (it helps if even the female Dwarves have beards and act in overly macho ways near viking like warrior culture ways).
Can I use they/them pronouns in a medieval style fantasy novel?
A simple answer is that you can but your characters can't.
Thus, when you describe the character's actions, you use gender-neutral pronouns but when the characters speak, they use "he" or "she" according to how they perceive the person.
Part of your plot could refer to them struggling to find acceptance in a medieval world but in fact if you read about Joan of Arc and other famous people in history, you will find that perceived gender was not much of an obstacle.
Several answers say or imply that the use of "they" to mean a single person of unspecified sex is a recent development in English. This is not true -- that usage dates to the 1300s.Some very well known and well thought of writers used it, including Shakespeare. However it was not in fashion during the 19th C nor most of the 20th, so it will seem "new" to many readers.
Many languages other than English did have a way to refer to a person of unspecified sex. (Some are Classic Greek, Classic Latin, Armenian, Kurdish, Persian, Turkish, and Mandarin Chinese). If such a language is being spoken at the time/place of your story "they" might be a reasonable translation. Some explanation of this might be a good idea (particularly if non-gender pronouns are used sometimes but not always), provided it can be worked in without breaking the flow. Perhaps a character will comment on the usage of another character and what it means.
If your work uses an invented language, then you are free to devise its grammar at will. Many fantasies have followed Tolkien in doing this, but it is not always a good idea for those less skilled with language than he was. Or only a few words of th "actual" language may be given.
Note that a person refereed to by a non-gendered pronoun need not be a person of non-binary orientation. Non-gendered pronouns were often used mrely to avoid being specific when not needed.
Some ancient societies were much more tolerant of non-heterosexual people and actions than others, including classic Greek society. If your work is set in something very close to a historical society, you may want to look at the practice then and there, The more it is its own invented thing, the more you are free to design it yourself.
In short you can handle this in any of several ways. But you may want to explain what the usage meant in your society, if it is significant, or would be distracting. How major a point you make of this depends on what you are trying to say.