Speculative fiction writers spend a lot of time on worldbuilding.
Even imaginary worlds have to be realistic and internally consistent. Readers are happy to accept a story of the future with advanced science, if it doesn’t contradict known science without a good explanation. They are delighted to accept that there is a fantasy world with magic, as long as the world otherwise seems as if it could be real. As Diane Duane said, “There is a rule for fantasy writers: The more truth you mix in with a lie, the stronger it gets.”
A created world has many levels, and things depend upon each other, as they do in our own world. So worldbuilding involves everything from developing geography and social systems, to the environmental characteristics, money, the religion or lack of religion, the technology, and many other things.
You need to know how magic has influenced the social structure. Who’s in charge, and why? Who’s at the bottom of the social structure, and why? You need to know how long it’s going to take your protagonist to get from Castle Tall to the Black Pits. You need to know how she gets her supplies along the way — are there plains villages? Nomadic warriors who have a tradition of hospitality? Big cities perched on cliffs where she will have to steal food? Will she have to work for alien overlords to gain what she needs? All of these choices require decisions about what kind of world your characters live in.
There are guides to worldbuilding online. The SFWA site has one by Patricia C Wrede. Holly Lisle has FAQ’s about her worldbuilding process, and io9 has a great list of Worldbuilding Sins.
It’s worth doing a workshop about the subject from someone knowledgeable — I did, at the Context Convention a few years ago, and learned a lot. Some nonfiction reading will inform your worldbuilding — books like Collapse, by Jared Diamond, that analyze the reasons societies fail, or histories of real civilizations. Some urban fantasy writers like Denise Verrico (The Immortyl Revolution series) base the cultures in their novels partly on real-world societies that they must research carefully.
But all that said: DON’T PUT IT ALL IN THE NOVEL. The worldbuilding is obviously important — but if you write about it in too much detail, your novel will read like an encyclopedia instead of a story. Description of your created world should be used in moderation. The real story is about the characters. Their struggles, conflicts and flaws are what will draw your readers in. Your worldbuilding will show in what your characters say and think, in what their goals and obstacles are — in how they react to the world around them.