At the top of my reading page as of this writing is a very nice post about worldbuilding blunders in Harry Potter. By pure coincidence, these days I'm writing my first substantial piece of fiction in two years, which is way too long. And the story takes place in a brand new setting, because I couldn't make it easy on myself. Where's the fun in that?
Moreover, my modus operandi is to make it up on the go, according to the needs of the story (for reasons I explained repeatedly in the past, but briefly: Tolkien was a goddamn genius, and his insistence on building the world first still almost doomed LOTR; you're not nearly as smart, or a tenured college professor). Lacking both the skills and the inclination to do the math on everything, it would be easy for me to mess up just as badly.
The trick? Be humble! As a writer, anyway. Don't pretend you know everything about the world you're building. Who died and made you an all-knowing deity? Your characters are people, so look through their eyes. There's always going to be more of everything, just past the horizon. Leave room for it. Where else will they find mystery and adventure?
Never mind that it's easy enough to run the numbers on some things, for example how many students were in my highschool: four years times six classes (actually that could vary), for thirty students per class on average — more in fact, but let's keep this simple — yep, comes up a plausible total for what I could see at opening ceremonies.
Never mind that. Mostly, educate yourself about the actual world you live in and its history. You know, little things like supply chains, government branches and what people did (or didn't) know four centuries ago, if not eight.
You're going to say that was harder before widespread internet, but even twenty-five years ago shelves were overflowing with atlases and the like, that one could use to learn. Heck, I grew up in Communist Romania, and it was still easy enough to get books on various topics, knowledge I can now verify with Wikipedia.
Speaking of which: maybe don't diss on Wikipedia when many writers prove they couldn't be bothered to check this one source of information, let alone more. It shows when they have insufficient or inaccurate information, and when they're just being a Karen.
Don't be a Karen.
P.S. Kids aren't stupid either, and they can often understand more complex topics than you'd expect. Show some respect.