There are a number of ways to approach the setting for your book. Contemporary settings and real locations are probably the easiest, but that does not let you off the hook when it comes to research.
1. You can use a real place.
This requires researching the place in question. You can use Google maps as a start. You can now go to Streetview and "walk" along the boulevard. You can visit the town if possible. If you can't visit, you need to thoroughly research the place to get the feel for how the people think, operate, dress, speak, and move about. The pitfall is using what I call "cultural shorthand" to describe it. People who don't live there won't know what Bob's diner looks like or where the Louvre is. So it's important to describe the place well. Even if you pick a famous locale, describe it as if you are seeing it for the first time. If you have never been there, you will have to use your imagination to fill in the details of how it looks, feels, smells, tastes, and sounds. You can research books and travel blogs or blogs written by residents of the place in question. You could consult their social media pages. If it is set in the past, see if you can find books written about the era, newspaper articles, or local historical societies. If it is so far in the past you can't find anything, you will have to make it up as best as you can. With Mythikas Island I set it in 3500 BCE on the Greek island Rhodes. It was impressive the amount of information about the topography, weather, moon phases, flora, and fauna I located. I found the beliefs, science, fabrics, jewels, weapons, etc. too.
2. You can use a real place and change the name.
The fun here is you get to name it Made-Up Town and change it up. Not all small towns or big cities are the same. You still need to invent the details. If you pick an existing town, you can rename all the businesses and streets and redecorate the town to your taste. The buildings can be clapboard or brick. The streets can be poorly paved or cobblestones. There can be derelict zombie infested malls or high-speed robocabs. The streets can have gaslights. The countryside can have quaint cottages. If you are thinly disguising the town where you live, others might recognize it. They will feel very clever.
3. You can create a new town, state, or country inside a real place.
Create a location that is in an existing place but apart from it. Most British cozy series invent areas of England and police departments. You should do some research into the closest places to get a feel for the area, but you can make it look and operate any way you like. Adapting an existing area is a little easier because you can research the topography, weather, access to airports, ports, perhaps beaches, lakes, police procedures for a mystery, etc. Use whatever you need for your plot and invent the rest.
4. You can keep it vague.
Some writers like to keep all descriptions vague so the reader can insert their own ideas. I personally hate that method. I like rich detail. I don't need to know the name of every plant. When writers don't describe their main characters or the setting, which I consider an important character, it feels empty and unsatisfying. Some readers don't mind. There are arguments for both sides.
Placing it in the fantasy or sci-fi realm is a ton of work. You have to invent who they are, what their world looks like, feels like, and tastes like. You have to invent the government, commerce, travel, morals, religions, and languages. What do they eat? What resources do they have access to? How do they obtain food, water, shelter, and clothing? Time intensive, yes, but also a lot of fun. Let your imagination run wild.
The type of setting you choose affects the genre and sub-genre of your book. Readers may be drawn to historical romance or prefer gritty urban fantasy. They may be turned off by certain eras like the specific wars. Some readers scoop up anything set in a quaint English village or a protagonist running a bookstore.
Setting can also provide promotion and marketing tie-ins. If you feature a city or town, local book stores may be willing to host a book signing, perhaps sell the book in their bookstore. If your beach read features a specific tropical hot spot, you could set up book signings there and write the vacation off as a business expense. Don't be shy about approaching local stores to see if they will feature your book. Many Barnes & Noble stores have a "local" author shelf. I have seen local author kiosks in grocery stores. For most book stores, returnable status is a factor, but they may still be willing to sell a few on consignment. In some tourist spots, books set there sell like hot cakes no matter how they are published.
Choose the setting that works best for your story. Do you need an ominous city, a remote island, or a tropical paradise? Do you need small town conflict or gritty urban crimes? Setting is part of your pitch and can be referenced on your cover. Always mention the setting (where and when) in your book description. It matters.
For further tips and reading check out these posts.
Mastering Setting, making the most of your setting.
Mastering Worldbuilding tools to craft a brand new world or examine an existing one
If you would like a paper version of the Build A World Workbook, you can pick it up here:
Build A World Workbook on Amazon.
There is also an ebook version:
Build A World Workbook on Amazon