In Lego Harry Potter: Years 1-4 for PS3, Xbox 360, and Wii, you can unlock an Invincibility cheat to have a little fun around the castle.
To unlock Invincibility, go to Wiseacres Wizarding Supplies in Diagon Alley and visit the vendor upstairs. Enter the code QQWC6B to enable the effect.