Fight King Slime, Eye of Cthulhu, your world's evil-biome boss, and Skeletron in roughly that order, then throw a Guide Voodoo Doll into lava to fight the Wall of Flesh — that's the whole of pre-hardmode. Hardmode is stricter: the three mechanical bosses first, then Plantera, then Golem, then the Lunatic Cultist, then Moon Lord, because each one is a gear check for the fight after it.
Pre-hardmode: loose order, one real gate
Nothing before the Wall of Flesh forces a specific sequence — it's a suggestion built around what gear each fight unlocks, not a lock. King Slime and Queen Bee are entirely optional and mostly reward armor and accessories that make the mandatory fights easier. Eye of Cthulhu is the one most players hit first because it can summon itself at night once you've got enough life and defense to survive the encounter. Whichever evil biome your world generated — Corruption or Crimson — gates its own boss (Eater of Worlds or Brain of Cthulhu), and beating it opens up ore for a real armor set instead of starting gear.
Skeletron is the one soft gate in pre-hardmode: it stands at the Dungeon entrance, and until it's dead, the Old Man who guards it (and the Dungeon Guardians patrolling inside) will flatten you if you try to loot the Dungeon early. Beat it, and the Dungeon opens up for real gear runs.
The Wall of Flesh is the hard gate. You summon it yourself, deliberately, by throwing a Guide Voodoo Doll into lava in the Underworld — it never spawns on its own — and defeating it is a one-way door into hardmode. Go in with a full pre-hardmode armor set, your best available weapon, and healing potions stocked, because the fight is a horizontal chase along a corridor you build yourself, and running out of arena or supplies mid-fight means starting over.
What actually happens when hardmode starts
The moment the Wall of Flesh dies, the world changes permanently and immediately. Two diagonal stripes sweep across the map in a V shape, converting existing stone into the Hallow on one side and spreading more of your world's evil biome (Corruption or Crimson) on the other, both extending down into the Cavern layer as new underground biomes. There's no undoing this through normal play — reverting to a pre-hardmode world needs third-party map-editing tools, which is why the wiki and every guide treat summoning the Wall of Flesh as a decision, not a chore to knock out early.
The practical reason not to trigger it carelessly: hardmode doesn't just add new enemies, it makes the old ones hit harder across the board, and the newly-spread Hallow and Corruption/Crimson can now encroach on NPC housing you built during pre-hardmode. Clear pre-hardmode content, gear up, and make sure your town is walled off from where the biomes are likely to spread before you throw that doll in the lava.
Climbing hardmode: the boss ladder
Every hardmode boss after the Wall of Flesh is a checkpoint, and skipping ahead usually just means dying to the next thing. Queen Slime is the one true optional stop — a good bridge fight between the Wall of Flesh and the mechanical bosses that drops Hallowed-tier accessories without demanding much prep.
Smashing Demon or Crimson Altars with the Pwnhammer after the Wall of Flesh is what actually produces the first tier of hardmode ore — each smash can spawn a new hardmode enemy, so do it somewhere you can retreat from. That ore, smelted at a furnace, gets you to a Mythril or Orichalcum anvil, which is where the mechanical bosses' summoning items are crafted from Souls of Light and Night — farmed at night from enemies in the Hallow and in your world's evil biome respectively. Skipping straight to fishing or crafting without that armor tier is how a first hardmode night against The Twins goes badly.
Plantera doesn't spawn on its own timer — beating all three mechanical bosses starts its bulbs growing on Jungle grass in the Underground Jungle, and breaking one starts the fight right there, so don't pop one without full hardmode gear on. Its drops open the Jungle Temple, which is otherwise sealed, and it also slows down how fast the Hallow and your evil biome are still spreading across the map. Golem lives inside that temple. Duke Fishron and the Empress of Light aren't required for Moon Lord, but both hand out gear that makes the last stretch noticeably easier, which is why most guides slot them in around Golem rather than skipping to the Cultist. The Lunatic Cultist and the four Celestial Towers that follow are the true final gate — Moon Lord won't spawn until every tower is down.
Expert and Master mode change the fights, not the order
Switching to Expert or Master mode at world creation doesn't reorder anything above — you still go King Slime through Moon Lord in the same sequence. What changes is how much punishment every enemy and boss can take and dish out, across the entire game, not just the late bosses. Bosses also gain new attacks and phases that don't exist on normal difficulty — Duke Fishron, for instance, adds an extra combat phase — and every boss drops a Treasure Bag containing accessories that don't exist outside Expert and Master worlds, on top of its usual loot. Master mode layers further difficulty on top of the same Expert-mode changes rather than introducing a separate system, so preparing for one boss fight on Expert is good practice for the same fight on Master, just with less room for error.
If a specific weapon or accessory mentioned above sounds unfamiliar, the items database covers where it comes from and what it does; if you've already reached hardmode and are wondering about the pearlescent liquid some players use to skip crafting steps entirely, that's covered separately in what Shimmer actually does.