But writing stories is very different from writing essays.
Between ten and fourteen, I was often shown the stories of Anne of Green Gables and Little Women as examples, in which both the woman protagonists discover that they need to stop writing extravagant fairy tales and write about something that they actually know - so they both write autobiographies, and nobody remotely minds that they were used in Anne's or Jo's stories, no matter how honest those stories were about the natures of their characters. And both women, of course, find spouses the moment they write about something they know. Both these stories annoyed me inordinately when I was younger, because neither L. M. Montgomery or Louisa May Alcott wrote autobiographies, so far as I know. Although they did write about the sort of lives they themselves had experienced, they were able to shape events in their books with relatively watertight plots and semi-idealistic endings. I think it is fair to say that there was a small measure of fantasy in each of these author's works.
While there are many writing advisers just waiting to tell you to "write what you know" with a bit of an emphasis on the autobiographical, no one tells you what to do if you simply can't - if it would open too many wounds in your personal life; if it would ruin many of the good relationships that you currently enjoy or at the very least hurt some of the people that you know; or if you find it simply impossible to open up about your own life... to make sense of your own life. I found myself in that boat. My Mum told me that I should try writing an autobiography about myself and my family life. The idea was repugnant to me, even though my life was good. The very odd time I tried writing about anything I knew, my creativity just completely gummed up. Writing became a depressing chore... a kind of report on reality.
When I was thirteen, my grandparents sent me an article about an Australian author called Kate Morton. In it, Morton said that it was important to write what you knew, but also what you "loved". I reckon she was on the money (and time, in fact, has proved that she was!). How in the world can you hope to write anything captivating if you don't love it? The passion must shape the art.
In the end, for me, I discovered that fantasy was one of the only things I knew. My brain simply worked that way. In my own life, whenever I would imagine my future, it always involved some supernatural occurrence or "magic" of some kind (not to be confused with the occult, naturally). Fantasy gave me a freedom unlike any other - I could write what I truly felt without even knowing it. It gave me the freedom to be honest about who I truly was. Writing what you genuinely feel about your real life can be a dangerous business, even if you're trying to be nice. In fantasy, no one would think to trace themselves back to particular characters or particular interchanges in your work.
The other thing no one told me was that sometimes you have no idea what you know until you start writing. I've learnt a great deal through writing, and I'm looking forward to learning more. And I don't think that's a bad thing.
In short, when someone tells you to "write what you know", don't let it get you down. In many ways, that has become mildly obsolete advice for a writer. And what's better than having a journey of discovery?