Everyone says to “write about what you know,” which is fair advice. But what a lot of people don’t think about is that setting may also be included there. Sure, it’s great to have a story set in a big city like New York or London or Dallas, but if you’ve never been there, it can pose a bit of a challenge for accuracy.
One way to avoid glaring inaccuracies is to do a little bit of research. Find pictures and articles about the city you want to write about; study the layout of the city on a map; find out where things are located, like the high school and restaurants. Ask people who have visited or who have lived there. Try to gather as much information about the city as possible. If you can, actually visit the city yourself. Walk around and imagine yourself as your characters. Do they fit in this type of city?
If you decide that writing about an actual city is too stressful, and you don’t want to risk making a mistake when writing about the setting, you can always make one up. Think about the type of town you imagine your characters in, and if you can draw from a few existing towns, you can combine features of them to help yourself imagine it. You can also just avoid naming a city or town at all. Nothing says you have to explicitly state the city your characters live in.
Once you’ve got the basic idea down, you can move on to more detailed aspects of the setting, like the floor plan of the characters’ houses or apartments and how the streets are set up. None of this has to be written into the story if it’s not necessary, but it’ll help you as the writer to know where things are in relation to each other. Take notes as you form your setting, as it’ll make things easier and help you avoid contradicting yourself.