Head to the upper right and pull a switch to open a gate so that you can pass through a door into an area where the sand slowly pushes you toward the right. As you advance through this area, note that the giant cobra-shaped statues in the background will spew flames that can hit you in the foreground. You'll come across a lot of enemies, and also a 3D Warpstar that carries you to the background for a 1up doll that you can locate to the left. Just to the right of that star is a door, but you should proceed past it to find a narrow tunnel to the upper right. Hit a bomb block to clear it, then proceed along it to find a Keychain. Then return to the door and enter it.
In the new corridor, you'll find sand pushing you left. Float above it and travel to the right to reach a Warpstar, then head into the background and venture back left. As you go, watch for a block against the ceiling that you can break apart for another Keychain. Left from there, you'll find a door on a high ledge. Enter it.
You are now standing near a magical pen that (as you likely recall) can damage enemies and interact with switches in the background as you progress to the right. Grab it and move quickly in that direction, hitting switches and enemies to drop various goodies, including a treasure chest. You want to keep moving, because the sand in the background is pushing everything to the right and you need to beat it. When you get to the end along your path, you can break apart some more architecture to reach a 3D Warpstar that'll send you flying into the backdrop. There, open the chest as it arrives near the far right. You'll obtain the stage's first Sun Stone. Other goodies may also greet you. Then you can ride a 3D Warpstar back into the foreground and head right a short distance to enter another door.
When you appear in the next chamber, you'll see a Waddle Dee in the background that will throw you an Assist Star. It's also obvious you can drop through the gray ledge, but don't do that just yet. Instead, float up the shaft to the right. Let the enemy explode, then kick apart the nearby crate to find the Rare Keychain: Shocked Dedede. Then return left and descend. You can choose between the Needle and Ice abilities, then pull a switch on the ceiling to the right and advance in that direction to encounter a mini-boss.
NEXT: Wild World - Stage 5