Find a name for your town or city. Come up with a name that sounds like the name of a town or city. Check maps to ensure the town doesn't exist in the state where you will set the story. If it does, your readers will assume you're writing about the actual town. You can use the name of a real town, just locate the town in a state other than where it exists. Consider names for your fictional setting that are similar in sound or spelling to real places.
Draw a map of your town or city. It doesn't have to be detailed, but a map will help you write about your town or city as if it's real. You will know what happens if you head east on Main Street or west on Third Avenue. You will know where your residential sections are, where the dangerous part of town is and what businesses are in town. These are details that will help you bring your fictional setting to life for your readers.
Populate your fictional town with people that give the town character. Create the types of businesses you'd expect to find in a town of the same size and in the same part of the country as your fictional town. If your town is in a state like Wyoming, chances are good there will be a farm supply store, if not in your town, then at least a nearby town.
Base your fictional town or city on real places to help you gain your bearings and structure, but avoid using specific landmarks that will give away your model town or city. If a landmark is important to the plot of the story, create a similar fictional landmark.
Locate your fictional town or city near a recognizable real life city to help give your readers an anchor that will make your fictional town or city seem more real to them.