During gameplay, pause, then press Up, Down, Up, Down, A, B, Right, Left, B, A, Down, and any further button. This will enable the debug menu, where you can change level, lives, and more. Press B to return back to gameplay; note that after this point you can use Select to re-enter the debug menu at any time.
Sound Test
At the first of the title screens, press Select to enable the game's sound test.