i will start this post with three disclaimers:
first, the most comprehensive resource for fantasy worldbuilding, imo, is patricia c. wrede’s fantasy worldbuilding questions, which asks nearly every worldbuilding question you could imagine. frankly, i’m not sure i could answer all of those questions for actual, real countries, let alone made up ones, and i wouldn’t want to! and i don’t think you need to either! but there are some superb questions in there and you’d probably want to answer some of them, depending on what your book is focused on.
second, consider the iceberg metaphor, which i think was applied to worldbuilding via brandson sanderson (though i doubt he was the originator of the idea), who said something like: “The idea is that you need to give the illusion that there is an iceberg there. You don’t actually have the iceberg.” you’re not going to include everything you know about your world in your book, unless you’re writing a compendium like the world of ice and fire.
third, ymmv (your mileage may vary). for example, if your fantasy is going to be focusing on politicking between merchant guilds from the perspective of a guild member, you’re going to want to know exactly how the economics of your world function. on the other hand, if you’re writing a quest fantasy from the perspective of a sheltered farm girl, economics probably isn’t going to be the main focus, so you could get away with only a superficial knowledge of that.
now that we’ve got that out of the way, i’m going to tell you the three main categories that i need to have fully established before i even start writing, and the questions associated with them that i need to answer. personally, i think these are all integral to having a solid foundation for building a world, no matter what kind of story you’re going to tell, and i will always make sure to know the answer before beginning to put the plot together.
government/politics:
what is the type of government (monarchy, oligarchy, etc)?
how was this government/country founded?
is there some kind of nobility and how are they addressed? can you become a member of the nobility? are you born into the nobility? how stratified are social classes?
do all countries have the same kind of government? if not, why?
what is the system of law? are there police/lawyers/judges/prisons?
how is the country managed? are there governors/ministers/local rulers?
how does the government tax its citizens, and if it there are no taxes, how does the government make money?
what are some of the major political factions active in government?
who gets to be involved in politics?
does the government provide education?
on a very basic level, how do the economics of your world function? (personally i am extremely dumb when it comes to economics and i like to ignore it until i absolutely cannot, but i think you should just have a general sense of how money works and if there’s some kind of banking system, even if this is only a very very vague sense)
religion and the afterlife:
are there multiple religions in this world? if just one, are there different interpretations of it?
do the deities actually exist and/or do they play a role in the affairs of humans?
is there a widely believed creation story?
if religious institutions exist, how much power/influence do they have over government and/or citizens?
is there freedom of religion?
what do people believe happens when you die?
are there culturally-specific burial rites?
are there culturally-specific prayer/worship rites?
how does religion view non-believers and how religious is this world?
do people take their god’s name in vain (also known as cursing)?
magic:
who has magic? why? where does it come from?
what can magic do? are there defined rules and limitations? what is the cost of doing magic?
how is magic perceived in this world? how are magic-users perceived? what status do magic-users hold?
how does the religion and/or religious institutions feel about magic?
how has magic significantly affected the way this world operates, if it has?
honorable mention #1: what language do people speak? as i’m sure you’ve seen, there’s often an ambiguous “common tongue” or “trade language” in fantasies that kind of goes unsaid, which is fine! it makes things easier and i don’t think it will make or break your story. but i think it’s good to at least consider how your characters speak, even if you end up just going the common tongue route. (and different languages can be a significant plot point too — like, is there a secret language known only to priests? or to magic users?)
honorable mention #2: what time period is your world set in? personally, this helps ground me in a time and place and guides how much technology i want to incorporate. but i like having a more rigid structure, and you definitely don’t need to adhere to that.
as you can see, this isn’t much, comparatively speaking! that’s why i refer to this as “barebones worldbuilding.” there is so much more that’s going to come up as you write your fantasy novel — traditions, customs, food (this is a big one, imo!), dress/costume (a personal favorite), war logistics, weapons, health and medicine, transportation, architecture, the freaking calendar and days of the week (this tripped me up so much in my first book), arts and entertainment, etc etc (again, see wrede’s fantasy worldbuilding questions) — but i think this is the very basic foundation you need to get started.
i’ll admit that, honestly, when writing the alamaxa duology, i didn’t consider all of these as much as i ought have before i started writing! as things came up along the way i realized how integral all of these questions were for me to have answered beforehand. it would have made my life a hell of a lot easier. now i know better, and whenever i’m planning a new fantasy i copy these questions into scrivener and answer them all thoroughly.
a quick tip: you don’t need to make everything up from scratch. for things like government/politics/religion, look at existing and/or historical nations and religions for inspiration, and edit as needed.
a final disclaimer: this is of course a prescriptive way of doing things. you don’t literally have to pause your writing until you’ve answered every single one of these questions, and of course you can always work these things in later, but i just personally think it’s easier if you know them going in, and by easier i mean prevents massive structural edits, which i hate!
and that’s it! i hope this was helpful!