Read a player's guide.
Seriously, though, there are tons of different paths through this level (one of the best designed levels in the game), but they all end in the same way: you have to find a P-Switch which makes a hidden door appear. If I remember correctly, the P-Switch is inside a block guarded by a sideways-moving thwamp. You have to move right over a conveyor belt, drop down, move left under the conveyer belt (jump over the thwamp), and hit the brick. Then break the brick next to it (if you are big) and jump back to the top, and hit the P-Switch. Then, while the P-Switch is active, run right across the conveyor belt (which will have stopped moving) and jump to the small ledge on the far right, where a door will have appeared. Go in the door and you will face Boom-Boom. The battle is sort of tricky, because it takes place on a long conveyor belt. Beat Boom-Bom and you're on to the grounds of Bowser's fortress.