Click the sand and the gunpowder. 5 Gunpowder + 4 Sand = 1 TNT. It will automatically use this formula, however to stop this (e.g. to buy a GP / Sand slave, which gives you more), you can press the Stop Converting button. If converting is off, you can convert to TNT by clicking on the TNT. (Don't get the black egg)
Thanks to @ComputerFido for helping out with part of the testing; I don't really have the time for the testing. Thank goodness I shared the beta.