If you're using an emulator and still can't figure out how to setup these codes, you're in luck! There's two common emulators for GBA games, the mGBA and VisualBoy Advance. Anyone playing on a physical Gameboy will need to purchase a physical Gameshark device to use these codes. If you're playing on an emulator you can usually input codes very easily by accessing a tab off the top of the toolbar.
This page contains Gameshark cheat codes for Super Mario Advance 4 (USA). Super Mario Advance 4 Gameshark Codes (USA)