You go to the shop, type in "a" until he looks surprised, when he looks surprised, type in the code. If you type the codein, and it says"try it!" bellow the picture, you got the item.
Here are a couple of codes, just in case you don't have them.
1. b,a,c,b,c,a,c,b = steak
2. c,b,a,a,c,a,b,c = stuffed animal
3. a,c,b,c,a,b,a,c = hair gel
NOTE: EACH CODE IS ONLY GOOD FOR 1 USE!!
These are only 3 of 5 codes. Legend has it that if you type in all five codes, your tamagotchi becomes invinible for 1-2 generations. I don't know if that's true even though I've typed all 5 in. The three above, I have memorized, the other 2, I got from another topic.