There's a lot of different ways that you can treat a stomachache, and it's really based on what's causing the stomachache. If it's something that you ate, or you ate too much, or something that's just didn't agree with you, you just need to remember not to do it again. That's the best way to treat that kind of stomachache.
If your stomachache may be due to a burning sensation, or may feel like a burning sensation, that may be gastritis or an ulcer, in which case you need to treat it by neutralizing the stomach acid. There's a couple ways of doing that. One is with either over-the-counter Maalox or Mylanta, which are called antacids, or H2 blockers, such as Pepcid. There are stronger proton pump inhibitors that really block the acid completely, and those are products called Prevacid or Prilosec, which is pretty common. You can get some of those products over the counter, as well.
If you're having stomachaches that are associated with constipation or stomachache with diarrhea, then you really need to treat those problems. So constipation is best treated by increasing the fiber in your diet and drinking a little bit more water. Once you start emptying out your bowels, that may help with your stomachache. The diarrhea is a whole other issue, because you've got a lot of bowel movements. So something over the counter, such as Pepto-Bismol, might help with the bloating and may help with the diarrhea and help to kind of make you feel a little bit better.