If you want a realistic setting or world for your story, you need to do some world-building. world-building involves defining, exploring and understanding how your story’s world is similar and different to the real world.
Your genre will influence the detail, focus, and level of your world-building. For instance, it’s a convention of fantasy stories to have detailed settings that are quite different from our world. In a romance story, readers don’t need super unique settings. They’re happy for the author to not put as much effort into worldbuilding, because the story’s world is usually a copy of the real world. Understand your genre before you start world-building!