One of the most important choices to make in fantasy and sci-fi is whether to set the story in a primary or secondary world. Put simply, primary world means Earth and secondary world means any other world. That said, like most things, the simple definition merely skims the surface of the question.
The primary world can be overlaid by other worlds—Faerie, a spirit realm, Olympus, the cyberworld (matrix, whatnot)—that may not be perceived by most people. Seeing the overlaid world(s) may require a genetic heritage (ex. fae blood), magical talent, a particular day of the year, crossing a particular boundary, or special technology (ex. a cyberdeck). Examples of overlaid worlds: Rick Riordan’s Percy Jackson series and Kane Chronicles, anything in the cyberpunk subgenre, Rowling’s Harry Potter series, almost anything by Neil Gaiman.
Secondary worlds become even more complex in terms of options. To start, secondary worlds may be Earth based or have no connection to Earth. If the setting is Earth based, the next question is: does Earth still have contact, or has it been lost?
All of these options have their pros and cons.
Primary World—The audience is already familiar with Earth, the cultures are pre-made, and languages are pre-made, and there are a lot of famous/historic people, events, products, and such to potentially reference to add depth. On the other hand, setting any story on Earth takes a lot of research, especially if the story is set in one or more real locations (chances are someone from the city, country, will eventually read the story). Likewise, the writer needs to take into account real history (or, if not, figure out why not). Primary world settings, especially in sci-fi, will also involve extrapolation of technology, culture, politics, and history. For other genres, such as urban fantasy and superheroes, culture and society may need to be modified, particularly if magic, non-humans, or superpowers are public, thus openly impacting society.
Earth Based—This story does not take place on Earth, but Earth exists and has some influence on the action and culture. Earth references can be made, the world can be created as desired, and the writer is not “limited” in history and culture. However, the setting still needs to account for much of the Earth info above, especially who on Earth knows about the secondary worlds(s). Typically Earth-based settings are used in sci-fi (Babylon 5, Stargate: Atlantis, Star Trek: DS9, C.J. Cherryh’s Downbelow Station and related novels), but it can also work in fantasy (Kevin Anderson’s Gamearth, Joel Rosenberg’s Guardians of the Flame, Terry Brooks’ Magic Kingdom of Landover series).
Lost Earth—Earth exists, but has been lost at some point in the past. In this secondary world, the former presence of Earth can explain Earth-like languages and cultures. It also has a ready made mythology. However, lost Earth has been done a lot, the writer needs to determine how much time has passed since Earth was lost, the influence of Earth over that time, and how much cultural and linguistic drift has occurred. This version has most notably been used by: Isaac Asimov’s Foundation series, Joss Whedon’s Firefly, and the reboot of Battlestar Galactica (I’m not knowledgeable enough about the first version to comment on it).
No Earth—This is a totally secondary world, universe, in which Earth does not exist and never has existed. On the upside, it offers total creative freedom. On the downside, it offers total creative freedom. Obviously, Earth references cannot be used, so more explanation rather than aiding description with a familiar Earth reference might be needed. Because the writer cannot reference Earth specifics to add depth, (s)he may wish or need to create an entire pop culture and any sub-cultures from scratch to achieve the same depth of detail, if desired. The most famous example is George Lucas’ Star Wars (despite using some Earth names—Ben, Luke), others include Steven Brust’s Dragaera (Vlad Taltos series) and Fritz Leiber’s Lankhmar (Fafhrd & the Grey Mouser).