Write an article based on this summary:

Know when to see a doctor. Try over the counter medicines. Understand underlying health problems. Have diagnostic tests, if necessary.
If your symptoms are not reduced after you have changed your eating habits and made lifestyle changes, you should see a doctor.  Also, see a doctor if your gas and/or bloating is accompanied by diarrhea, bloody stool, change in the color or frequency of bowel movements, chest pain, unintended weight loss, or severe abdominal pain. Keeping a journal of your symptoms will help your doctor diagnose and treat your condition.  Your journal should include what you eat and drink and how often you are passing gas. Beano and simethicone (Gas-X, Gelusil, Mylanta, Mylicon) can help with gas.  These medicines are not always effective, but they are worth a try.  Beano can be added to your beans and vegetables.  Take it with your first bite of food to be effective. Simethicone products break up gas bubbles in the gut and may provide some relief for gas-related abdominal discomfort. Gas and bloating can indicate an underlying medical condition such as irritable bowel syndrome (IBS), Crohn's disease, diverticulitis, or other intestinal condition.   If you are belching excessively, you may have peptic ulcer disease, gastroesophageal reflux disease (GERD), or gastritis. Your doctor may suggest some testing to determine the source of your gas and/or bloating.  Common tests include abdominal X-rays, sigmoidoscopy, a barium swallow, or a colonoscopy.  A colonoscopy allows your doctor to see any issues in your large intestine.  A long tube is inserted into the rectum until it reaches the colon.  A sigmoidoscopy helps your doctor identify causes of diarrhea, abdominal pain, and constipation.  A short, lighted tube is inserted into the rectum to view the intestines.  A barium swallow is used to determine the causes of chronic belching.  You would swallow a liquid (barium) that coats your organs so that the doctor can see them on an X-ray.