I tend to write a lot of fantasy, sci-fi and superhero stories. Sadly, I have never been given super powers by a science experiment go wrong, nor have I ever been a werewolf or been to space.
But, some days I fake it pretty well. Or at least, my characters do.
“Write what you know” tends to be a confusing and limiting piece of advice. People assume it means you can only write from your perspective about things you’ve experienced first hand. While I do think research and experience are important, the stories I dream often outside of my area of experience.
It also comes back to writing the emotions you know, because that is what will resonate with your audience. You may not know what it’s like to be an alien princess, but you probably know what it’s like to have your heartbroken. Most of us, at some point in our life, have felt pain, loss, joy, exhaustion, anger. If you think about the books you’ve read, even those with some mistakes about setting or details that research could have helped, you may still love them despite their flaws, because they made you feel something.
If you want to write a story about a mental illness, but you have never had one and don’t know someone who does, that is what research is for. Many people want to share their story, so the best way to learn more, is to ask them. I’d suggest this for any subject you don’t “know” but especially real places, real people, and real conditions that exist. Readers will forgive small errors in these factual things, but too many will pull them out of the book.
In the end, it is all about balance. Share what you do know about life, feelings, emotions and research what you don’t. Try to remember the kinds of inaccuracies that pulled you completely out of a story, and the things that kept you in the story despite them.