For me, keeping a food diary of what I ate, when I ate, and all health symptoms gave me the keys. I found out afterwards that a few family members have the problem, as well (neither side is very close).
Gas/bloating/belching can be from a lot of things, ranging from how much fiber you're getting (or not getting) to eating your food too fast (swallowing air while you eat) to food intolerances to food allergies.
Think of diarrhea is your body's way of saying "Oh Shit!" literally. Something has been introduced to the GI tract that makes it VERY unhappy and it wants that out of there ASAP. Stress can give you the runs, but again, if you see a pattern with regard to food then you start to tweak out the problem.
Why do you think you have this problem?