Codes go through the official KingsIsle site, not inside the game client. Log in at the Wizard101 website, then look for the code redemption section — it's usually labelled something like "Redeem Code" under your account or the help area.
Type the code exactly as given, capital letters included, and confirm. Rewards typically appear in-game the next time you log in.
Keep your account details to yourself while doing this. No legitimate code requires you to hand your password to another player.