The “write what you know” Maxim is a bullshit excuse to not writing marginalized characters because “what you know” isn’t a static concept. Knowledge isn’t a static concept.
Good writers research. That’s what “write what you know” means. If you want to write it, learn about it. That’s why there are entire Tumblrs dedicated to amassing historical accounts of Brooklyn during the Great Depression so that Bucky and Steve can bang with complete historical accuracy, because if we all wrote what we knew, fiction as a concept wouldn’t exist.
So really, if you don’t write people of color in your fiction, it’s not because you don’t know, it’s because you don’t want to.
It’s write what you know, not write what you’ve lived