hi! well you go to the game section (the ball and the baseball icon) and you scroll down to where it says password. then you'll see some guy there and you press B i think. and then you type in the code you got by pressing A & B buttions. then you and your tama get what ever the secret code was for!
If the secret code that you've mentioned is all numbers then it's a password. You enter it in the Password area on your Tamagotchi.
If it's all letters, such as ABCBA CBABC, then it's a shop code. Here's how to enter shop codes (quoting from the V3 instruction sheet):
At the shop counter screen, press button (A). Then, press button (A) quickly three times. When the shop owner’s face appears surprised, punch in the secret code to reveal a new item.