Apologies for the brief and fairly useness nature of my reply but it stupid o clock in the morning and I just wanted to point you in the right direction.
Two things can happen here:
You are trying to cheat on a real cart, your options are buying some form of cheating device (action replay, gameshark, codebreaker...) I suggest reading their sites for these and this was not your question.
The other option is a flashcart, first check your cart does not have the options to cheat (a large number of GBA carts had cheat support added so check your carts documentation/FAQ's).
Of course if you are not so lucky there are trainers and GABsharky, trainers are another area so I will leave those alone.
GABsharky is a nice app that allows you to add cheats to your roms and use them like a trainer. When I checked last the site was down but a simple search or request should bring it back (I do not think I have it kicking around my machine but my gig worth of GBA releated stuff (no roms in that) may say otherwise)
As for gameshark/action replay codes they are encrypted, fortunately they have decryption tools.