Alright, so you want to make a game trainer, the first thing you'll need is Visual Basic, the second is a game, the third is Cheat Engine (www.cheatengine.org) and that's about it.
What you'll want to do is make a new visual basic project and add an existing item, make it the following module: http://adf.ly/I9AhV (you need to download it)
So once you've got the module installed you'll want to open it up and find the "Terraria" part and change it to the name of your game, i.e "Halo" or something like that.
Next, you'll want to go back to your form and create a textbox, and a button, then double click the button so it opens the "On Click" event. this is where we need CheatEngine.
Open cheat engine and open your game and then look at how much health you have in the game, then go into cheat engine and scan for the amount of health, then go back in game and injure yourself so you loose health, then go back into cheat engine and scan for the new amount of health, that should narrow the results down to a few or one, if it's just one copy down the address and then go back into visual basic and write in the "On Click" event of the button: WriteInt('addressgoeshere', textbox1.text) note that when you put the address in you'll need to add &H at the beginning so that it doesn't screw up.
So you've successfully changed your health now, debug the program and change your health then check in game just to be sure. you can do this for Ammo, Armor, you could probably even do this for online games, the only thing is i doubt you could modify your health or armor or ammo on an online game as that stuff is usually handled by the server, so you can't modify it at all.