I usually bristle at blowback against writing advice, because the blowback often comes from people the advice isn't meant for. But one piece of writing advice that really is bad is "Write what you know." On its face this advice precludes most genre fiction. For that reason it can be safely ignored.
Writing requires imagination, a mind that ventures outside the known. If I wrote what I knew, there'd be little variety in my writing. My stories would be stale and predictable. So with every story I've written, I've reached beyond my limited frame and learned something. Mostly technology and occupational stuff, but also character types who aren't like me—especially people not ethically like me. To keep it fresh, I have to be able to write more than one type of good guy and more than one type of bad guy.
F Scott Fitzgerald said intelligence is the ability to hold two opposed ideas in mind at the same time. I say that's more a necessity of imagination than intelligence. The writer creates drama and tension by bringing characters who believe in what they're doing into conflict. Neither one of them has to be right by the writer's personal standards, but they should think and act as if they are.
There is a stunning lack of imagination in "mainstream" science fiction and fantasy today. It shows in the puritanical and Pharisaical attacks from today's celebrated writers and publishers on dead writers and dead editors who built the market for the former to sell books to. Today's supposed standard bearers cut off their literary ancestors because of their transgressions against the idols of the present age.
Modern sci-fi/fantasy writers seem really intent on just hating on the people that paved the way.
— Vik and Me (@ViktorGorchev) February 28, 2020
Can such narrow-minded, reactionary writers faithfully explore the range of human experience that connects with the broadest possible audience? Can they characterize a patriotic soldier, religious disciple, or Brexit voter without inserting their contempt? Or, will they "write what they know," effectively cutting their readership by 80% before the book goes to print?
I don't pretend I don't have a point of view, but I'm humble (and hungry) enough to know my point of view shouldn't be the only flavor in my writing. It would bore you. It would bore me as well.
As always, let me know what you think in the comments. If you like hard sci-fi that's neither didactic or boring, check out my books Seeds of Calamity and Tendrils to the Moon. You can find extended previews for each here and here.

NK Jemisin, Brandon Sanderson, and YouTuber The Closer Look all liken worldbuilding to an iceberg. The tip of the iceberg you could call the "here and now" story elements: places, characters, motivations, tension, plot: the things that propel the story and hold the reader's attention. The bigger underwater part is history, backstories, metaphysics, religions, cultures (HBMRC). Without these things, the here and now story elements wouldn't fit together—not well, at least. That's the craft of worldbuilding.
When the hero McMurphy gets committed to the psych ward, his stay becomes a battle of wills: He's big, brash, and rebellious; Nurse Ratched is cold, controlling, and manipulative. McMurphy mounts a campaign to break her vice-like grip on the patients and the hospital staff. Through sheer pig-headedness, he's mostly successful. He wins the patients' rights to play cards, to watch the World Series, and to leave the hospital to go fishing.