1. Get Cheat Engine and install it.
2. Go to the game you wanna hack. Im gonna hack Thing Thing Arena 3.
3. Open Cheat Engine.
4. Click on the computer and select a process.
5. Then think about the thing you want to hack. For example if you were to hack ammo, take the value and multiply it by 8 and then click first scan.
6. After that you should see something like this.
7. Next we have to modify the value. Im hacking ammo, so I would simply shoot a few bullets. Since im deducting from the value I would click decreased value and then press next scan.
8. Keep repeating step 7 till you only have 1 value.
9. Highlight that 1 value and click the red arrow.
10. Then right click the value and change it to what you want. After you change it tick the box that says frozen. After that click frozen and go back to your game.

NOTE: This is not like making a prehack. If you change the value and make it too big it could crash. If you want infinite ammo just freeze it. As long as cheat engine is open the ammo will be frozen aka infinite ammo.

Here is a Video TuT.