I have read authors talk about only writing what you know. The premise behind that is you won’t be able to describe in depth something you have never experienced.
While I agree with that to an extent, I have to disagree with that as a “writing rule”. The reason I have to disagree, is science fiction “prophets”, among many examples.
Sci-fi prophets wrote books that invented many current science projects. There are other authors, one who writes a post apocalyptic military series who was never in or involved in the military. Since he started writing his books, he has had so much positive feedback from deployed troops, that they have provided him with research for his future books.
Many writers write in a genre they have never read and write such unique stories that they are loved by hard core fans of that genre.
Many spy thriller authors were never spies. Yet people love their books.
Many men write female protagonists, some do it very well, according to women who read their books.
So I would say, instead of “write what you know”, “write what you can imagine thoroughly” would be a much better rule.