The old adage, “write what you know,” is a good place to start for some writers. Unfortunately, it's used by some critics, editors, and even writers themselves as a straight-jacket stricture to mean, “write ONLY what you know.” That is egregious nonsense.
No science fiction would ever have been written, because if it hasn't happened (yet), then you can't write about it. Historical fiction is out, too, because the authors weren't alive then, so Margaret Mitchell shouldn't have written Gone with the Wind, or Edith Pargeter shouldn't have written the Brother Cadfael mysteries? Zane Grey, a dentist, so he shouldn't have written the classic Western, Riders of the Purple Sage? And we can't even begin to discuss fantasy, because everyone knows there are no hobbits, wizards, or pissed off dragons named Smaug.
The more pernicious side of this stricture comes into play with socially charged topics, such as racism, religion, sexual orientation, or family dynamics. A sister writer in a science fiction romance group recently described how she wrote a post-apocalyptic story about a Haitian man and woman struggle to survive after a global pandemic. She received a firestorm of criticism from her writing critique group that accused her of insensitivity at best and outright racism at worst because she is white and her characters were black. Not because the story had structural problems, or unbelievable characters, or whatever is usually wrong with drafts, but solely because she wasn't “allowed” to write about black people as main characters who fall in love. Sorry, but I have zero patience for that kind of political correctness run amok.
By the same logic, Anthony Hopkins shouldn't have been allowed to play Hannibal Lector in Silence of the Lambs because he didn't have personal experience as a serial killer. The women who write sweet or raunchy M/M romances shouldn't be allowed to write them because they aren't homosexual males. I've had deeply personal and compelling discussions with African American friends about the subtle and overt bigotry they and their children have experienced, but because I'm white, I can't write about it? I will accept criticism if my African-American female character is two-dimensional, or too competent (“Lt. Mary Sue”), or too stupid to live (“don't get in the serial killer's van!”), but NOT because I'm white. I will accept criticism if my male Chinese main character is unbelievably naive in the face of rising evidence, but NOT because I've never been to China. I will accept criticism if my gay male supporting character is too flirty to be a waiter and keep his job, but NOT because I'm female.
Writers are observers, commenters, presenters, and storytellers. We writers have a gift, an inclination, a drive to find the right words, the best perspective, the perfect detail that communicates what we want to say and the tale we want to tell. We need to update that adage. It shouldn't be “write what you know,” but “write what you imagine.”