how to make power-ups?

A lot of games have power-ups. i wanna know how to make one that actually works, and how to make it to where when the enemy hits the player they lose the power up.

or go megaman style, where you can switch between powers in the menu.

nvm. this link to a forum page told me everything.