When I hear people saying you don't have to just write what you know, I'm drawn immediately (as I am with quite a few things these days) to what I know and particularly what I used to study in philosophy. With my freshman classes (standard Philosophy 101, a kind of thematic introduction to the major ideas in western philosophy) I spent a lot of time on Descartes and Hume, and what they thought it meant to know something, where our ideas came from and what made them true. And Hume had this rather interesting idea that I think might be helpful when it comes to the whole "don't just write what you know" claim.
Say a friend knew you liked Harry Potter books. She'd never seen the movies or read the books but she'd heard the word Hogwarts and she's interested to know about it so she asks you what kind of place Hogwarts is. You might describe it as something like a boarding school but with courses we don't really have available to us, like herbology and potions. She knows about boarding school (perhaps she went to one herself) but she has no clue what you mean by herbology and potions. So you start with herbology and say it's kind of a cross between botany and homeopathic medicine, but with more of a focus on just when to harvest certain plants because that affects their usefulness. And with potions you'd say it's kind of like chemistry, but it's different because... whatever you think potions has that chemistry lacks, or that would be true of chemistry but not of potions. And on down the list. The point is, if you want to introduce her to a new concept you're going to have to start with things she knows, things she's observed, and throw in components she knows from another context. If I didn't know what a square was, telling me "it's a kind of rectangle where all the sides are equal length" will only help me understand it if I already know what we mean by rectangle, sides, equality, and so on. I may not be used to putting all those concepts together, but if I don't already have the building block I'll never know what it means to be a square. And if I don't have some knowledge of botany and homeopathy and the other qualifications you threw in I'll never understand what is meant by herbology.
That's Hume's basic point. There are two basic ways we can learn about something. Method #1 is the simplest: see it for yourself. Get some direct impressions. (Impression = a technical term, which essentially means sense-data, the sights and sounds and so-forth that we observe directly for ourselves about something.) So if I want to get an idea of what the situation is like in Ferguson, I could go live there myself. I could get second-hand accounts from books or other people's stories that would help me form an incomplete picture, maybe. But method #2 is synthesis. If someone told me that it's not so different from Glenville, an area of the Cleveland area I knew when I was in grad school there, except that there's less crime and more people put in jail for things that don't seem clearly criminal (like being unable to pay parking tickets), which leads to mistrust of the police. Or whatever the person trying to help me understand Ferguson thought was the pertinent difference. The point is, you start off with something you know, add in or take away something else you already know but don't usually associate with the first concept, and you get an approximation. of the thing in question. It works that way for fictional things, too. Dragons are really huge lizards that can fly and breathe fire. Hobbits are short people. A unicorn is like a horse but with a horn growing out of its head, etc. Elves are kind of like humans but they don't die of old age, etc. Sherlock Holmes is a man with a genius both for forensic chemistry and for more general deductions about situations described to him. And on the list goes. The point is that you can't know what it means to be an elf unless you can work out what it would mean to be human in a society where people didn't have set lifespans. You have to know both components and how they fit together to understand what it means to be an elf.
And I think Hume is basically right here. Not that we only know things we've perceived directly or perceived the parts and put together using our imagination; I think there are some things we just know, innately, without having to perceive the idea. But on how we learn new concepts, hwe we wrap our heads around things we don't already know, his approach seems pretty accurate to how my own mind works. I can't know what Paris is like unless I can relate it to things I already do know and modify it so parts of it are like New York, parts of it are like Munich. [Bad example as I actually have been to Paris a few times, but work with me...] ANd I can't know what it would mean to be an elf unless I can work out what it means to be a human and how adding indefinitely long lives into the mix would change things. (As I'm unlikely to actually meet an elf myself.) This seems to be how cognition and imagination work, both with actual things and with imagined things.
So what does this have to do with writing what you know. Just this: if people are hearing the write-what-you-know rule as saying you can't write Denethor because you've never been the ruler of a quasi-medieval realm, you can't write John Watson because you've never been to war, etc. obviously that's bad. You can write all of these things and more - but you need a way to understand what it means to be a veteran and what it means to return home. And the best way I know to do that is to get some understanding from somewhere to what goes into that psyche and to find some way to relate to it.
Let's take John's character on the BBC version of Sherlock. I have never been a soldier, let alone one who was booted out. I have known American veterans, some recently turned into civilians, both in my students and in my own family. I also can relate to some of his experiences: the debilitating conditions that seem "all in your head" and so not real, the nightmares, the transformative experiences that separate you in a way from people who haven't gone through them. I can sympathize with John clenching his fist as Mike prattles on about growing old and getting fat because I've had so many conversations like that with people who seem to have such normal lives. So if I were to write a story built around that scene, I could (and I'd argue, should) tap into my own similar experiences. Of course they'd be different because John has experiences and elements to his personality and experience that I lack, but the starting place has to either be direct experience of people like him (say, hanging out around veteran doctors or men with psychosomatic injuries) or it has to be a synthesis of different parts we've encountered in different contexts.
Of course, some people write great fanfic (and fiction) where they share the same background as the characters. The most recent example I've come across is probably In Confidence by emmadelosnardos, a story about Sherlock's time in drug rehab written as session notes and transcripts - by an author working on a Ph.D. in clinical psychology, if I remember correctly. Certainly training in the psychological sciences, and someone who had the practical experience to where both the mindset and the style of writing came easily. (One more for the "I really must write up a proper recommendation for that" pile, and one I highly recommend to any Sherlockians.) But even then, the author has never been Sherlock's therapist so she still had to synthesize the experiences she's had with ones she hadn't had in that context (maybe dealing with a genius client or a musician client or a client who had any of the spoilerish issues Sherlock does in that story, which she might have had in some version in other clients but I have to imagine not all together like that). That seems to be what it means to create a fictional world: to combine the things we know in a new way that lets us tell the story we want to tell.
But it has to begin somewhere, and the experiences we have -- of someone alienated from his friends and family, of a worried parent or sibling, of someone with psychological or physical or financial problems of some sort -- can and should be part of that picture. It's the most organic way I know to do world-building and character-building, the way that seems to get across all the complexity of humanity. And sometimes there will be things outside our experience where we need to do some research or talk to someone coming from a more similar world, but I think writing what you know in this way can be a good way to write convincingly. Of course we shouldn't write just what we know. But the tattoo artist who's writing a Sherlock-as-a-tattoo-artist AU, the horseback rider who knows what it's like to ride a horse all day long who tries to parlay that into a story about Eowyn riding to Pelennor Fields still has to do the synthesis thing. If there's no synthesis at all, that's writing a memoir or a history more than fiction.
So if that's what we mean by "write what you know," I say good riddance to that rule. It's limiting and unnecessarily so. But I don't actually think it is what the rule means, certainly not what it has to mean, and I worry that sometimes some writers go too far to the other extreme. Certainly in my own writing, I think I've done my best work when I started with what I knew and used that as the building blocks for the story I wanted to tell.