They are inexpensive, they are easy to make, they are safe and effective. Teas of various kinds make the perfect home remedy for all kinds of digestive distress. Just match the right tea to the symptoms.
For heartburn, any tea that dilutes stomach acid will bring relief, and calming teas are best. Chamomile, catnip, lemon balm, and aniseseed brews all reduce the intensity of the reflex that makes the stomach churn out acid. Just don't brew them too long. Bitter herbal brewed beverages, and bitter food and drink of any sort, activate a reflex that increases acidity and aggravates heartburn and gastroesophageal reflux disease.
It's not often that a medical journal will recommend an herb as the first line of treatment for a medical condition, but that's the case with peppermint for irritable bowel syndrome. When taken in an enteric-coated capsules in a 180-200 mg dose three times a day, peppermint oil relieves the bloating, constipation, diarrhea and gas of mild IBS in adults and the same symptoms with mild recurrent abdominal pain (diagnosed by a doctor) in children.
Peppermint tea works almost as well as peppermint capsules, but you have to be careful how you brew it. The active ingredient in peppermint is the essential oil (never, by the way, take straight essential oil of peppermint, it's just too much). The essential oil is very volatile.
This means it boils off from teas, and you must (1) make your peppermint remedy in a container (preferably a teapot, although just placing a saucer on top of the cup will also work) and (2) use water that's just beginning to bubble, not at a full boil.
Finally, for flatulence, even for explosive flatulence that can cause so much embarrassment at work and in social situations, consider fennel seed tea. You make this tea by crusshing fennel seeds and making your brew by in very hot water for 5 to 10 minutes. Like peppermint, fennel is more effective when it is brewed in a teapot. Just how fennel seeds work is a mystery to modern medicine, but many people find them to be an almost instant cure for gas.