Instructions
Obtain an Invincibility Star. The Invincibility Star is a staple of Super Mario Bros. games dating back to the original game. This star can be obtained in certain Question Mark boxes throughout levels. When you happen upon a box with a star, the star will come out of the top of the box and will glow yellow in color. It will also blink.
Run into the Invincibility Star. This will temporarily render your character (either Mario or Luigi) invincible. Your character will blink while this is happening.
Run into the ghosts throughout a level, killing them instantly. Pay close attention to your character as he blinks with invincibility. When the blinking stops your character will no longer be invincible and you can no longer kill ghosts. Touching a ghost while you are not invincible will kill your character instantly.