You'll need the hammer
ability for this level. A quick way to get it: The Yogurt
Yard arena, or from Bonkers in the beginning of 6-3.
When you get to the part with Waddle Dees
on a bunch of blocks (after the block passages), don't
smash the blocks! Instead, only smash the first two so you
can smash the Waddle Dees as they come out. Jump on the
blocks, and then jump and use the hammer to smash the
blocks above. You'll be able to access the top right door,
which leads to the switch!