If it's just a fantasy world it's a stream of consciousness, based around a theme, if any (ie medieval world, cyberpunk). For me I just let my mind go wild for a bit. But when you have a story in mind, you need to focus on the story and how the world you created guides the viewer through the story.
A common thing a beginner may do is get so caught up in the religion of their world, that it either steers them off their main plot, or bores viewers with unnecessary details. Or overwhelms readers with a tsunami of details when they barely get to meet the protagonist.
You want the readers to explore the world through the classic "Show, don't tell" concept whilst being immersed in the plot.
So, I just let me mind run wild before connecting all the pieces of the universe I created to fit into the plot (let's say, a boy searching for excalibur or smth)
If we want something more commonplace, I imagine the world will be our world so you can skip all the religion and government structure (unless it pertains to those topics). And build the lore of the characters and their surrounding community to the story (ie, a shy LGBT+ kid, a group of friends who fell apart after x happened)
I know it's hard to share ideas clearly but I mostly think off my head that will build the plot, taking notes as needed (like a messy psychopath-like collage of words on printer paper). Taking influence from real life as well, and friends as @thegreatartisan points out.
Then, I organize it into a specific format I use for my stories. And get into gritty details (synopsis, thumbnails, dialogue, then the actual pages)
But you will have to find the style that works best for you.
TLDR for my graduate thesis up there,
You want your viewer to take interest and be able to immerse themselves in your world BUT alongside the main story. Though there's different approaches, I'm a big believer of the story driving the world you create.