Trainers tend to come as a patch, for the GBA this means IPS format, GBATA is the de facto IPS patcher for GBA releated stuff (if I play around with DS IPS patches I use it after renaming the roms too): http://www.gbadat.altervista.org/tools.htm
DS roms being larger have to use a different method, this is usually BSDiff which comes with the trainers.
I have also seen patches/trainers in NINJA and Xdelta formats although the NFO will take care of issues here.
However the patch should come you will ultimately end up with modified rom, burn this as usual.
Trainers will be activated in one of two ways (there is a third but no GBA/DS trainer I know of uses it)
1) An intro screen where you can select options (see screens above)
2) In game commands, more rare (Daisenryaku DS - Great Strategy for the DS has a trainer that uses it) and any commands will be detailed with the release notes.
@GLiTcH under the tools section of http://www.advanscene.com/ there is a guide, I warn you now it is a very involved task.
Cheating on the other hand (which can accomplish the same goals if not more) is relatively easy so I suggest you look into that.
If your cart does not support cheats then do a search on GABsharky, if you are using an emu then you have no worries.
Those trainers are for fun in the first place. Nowdays trainers are often not needet anymore, cause games are sooooooo fucking easy today, so everyone could complete it in a few hours. But I love RISING SUN for doing such loveleeeeey trainers, cause no one cares about cracktros and traintros in general anymore. And this reaaaaaaly pisses me off !!!
What is a release without a flashy cracktro infront of a release ??? Tell you what. Thatz what I call fucking gay !
KEEP THE VIBE ALIVE !!!! DON`T LET THE CRACKTROS FADE AWAY !
I probably should have mentioned lunarIPS as it is quite good (to tell you the truth I often use that or ipsXP too as waiting for a CRC32 on a 128mbyte game while doing all the other crap my computer does just for a little patch is not fun).
The third method is an in game menu (hold L and R and press the face buttons or some such to bring up a menu), it is possible if unbeliveably complex (I have seen examples but I can not remember what they were) and normally is reserved for PC games, old consoles or stuff with sources.