That's been a problem for me too. The rule is "write about what you know," right? So if you're going to write about something you don't know well, you have to learn as much as you can about it so that you do know. How do I do that?
I was looking at the "thanks" section of my copy of Memoirs of a Geisha. The author made several trips to Japan and talked to several geisha's about their lives and childhoods, as well as experts on Japanese culture and mannerisms, as well as just Japanese people who grew up during World War II. He also read a lot of Japanese poetry which greatly informed the prose style. Thing is, not everybody has the resources (or is dedicated enough) to do this. So what other ways can we write while looking like we know what we're doing?
We write from experience, so, essentially, what those authors are doing is deliberately experiencing something so they're able to write about it. Often, the reason we choose characters with certain lifestyles or who live in a certain place, is because we've experienced them in movies, TV Shows, books, etc. I can write an imitation version of Memoirs of a Geisha once I've finished it. A lot of writers, especially screenwriters, rely on this instead of actual research. If they are writing a mafioso, they watch the Godfather, instead of interviewing actual mafiosos or mafia experts. At best, they'll read a book on them or watch a documentary. This is one solution. It does not match up to actual research, but the reader may not be able to tell the difference. (Note: This is why you have a lot of unrealistic tropes in film, so beware).
The other solution is that we can simply write about what we've already experienced. Harper Lee did this, John Kennedy Toole did this, etc. We can write almost literally about it, or we can abstract that experience into something else. I can describe and personify run-down southern American towns well because I've seen a lot of them. Many people base their characters on people they know, and write about places and cultures they've experienced (or the equivalent in their fictional universe).
For the average writer who cannot travel to the place they want to write, they are probably going to want to use a bit of both of these.