For example, if you are writing a story about a fortuneteller who lives in Miami, you do not have to be a fortuneteller or from Miami. You had better have done quite a bit of research about Southern Florida, though. You have to know how the city is laid out, how the people talk, what they eat, etc.. What cuisines are the most popular there? I am no expert. I would think that Miami would have a wide variety of ethnic cuisines available, but I have never been there or researched that area. If I were writing a story about Miami, I would find that out before I included it.
If you say, "That's OK for you, I write fantasy, so I can just make it up," you still need to know what you are writing. If anything, fantasy is the most important kind of fiction to know what you write. You see, in a fantasy world there are no rules. The rules of physics don't apply unless you say they apply. You have to know whatever the rules of magic are for your world and be consistent with them. It is horrible to be reading something where one set of rules work and then later find the world is following a whole new set of rules. In addition to the rules of magic, you have to know the political and sociological structures of whatever lands are involved in the story. The history of the world can also play an important part of how people react so you should have a basic history worked out as well. Fantasy and science fiction tend to take the largest amount of time to write because of how much time they take to world build. It is essential to world build before you start writing.
Think about what it would take to write what you know if you were a mystery writer. You could only write a murder mystery if you had either solved a murder or committed one. That's a scary thought. The bottom line is that you do not have to draw everything you write simply from your life experiences although that can be a good place to start. You do have to do your research and be knowledgeable about whatever you write or no one will find your story believable and will have a hard time connecting with it on a personal level.
If any of you write, let me know about it. It's one of my favorite releases.