To use GameShark codes, you'll first need an actual GameShark device for your console. It's a cheat cartridge system designed to accept and apply codes to supported games.
Once you have the device, you can enter codes through its menu, either by typing them in manually or loading them from a saved list. After the codes are active, they'll take effect when you launch the corresponding game.
Just make sure the codes match both your game and its region, since mismatched codes often won't work.