First of all, be sure you actually have a problem. During eating and swallowing, air is introduced into the digestive tract. In addition, bacteria in the large intestine produce gas as a by-product. The air and gas are normally expelled as flatulence which may, or may not, have a strong odor. Studies show that people normally “pass gas” up to 22 times a day, often without noticing. The odor of flatulence is determined by many things including what you eat, the health of your digestive tract, and the kinds of bacteria in your intestines. Certain foods contain substances that are not completely broken down by enzymes and, when they reach the large intestine, are consumed by bacteria, which generate strong-smelling gasses such as methane and sulfur dioxide. The most common culprits are lactose (the sugar in milk), fructose (a sugar found frequently in processed foods and soda), and certain carbohydrates found in beans of various types. Strong-smelling flatulence is also associated with constipation or other problems in the digestive tract such as irritable bowel syndrome or insufficient production of pancreatic enzymes.
If you are concerned about flatulence, see a doctor and talk openly about it. You may need to change your diet if it turns out you are intolerant to certain foods (i.e. lactose). Although they are commonly associated with flatulence, beans do not actually cause excessive flatulence in many people and should not be avoided because they are such good sources of protein, fiber, and a range of other nutrients.
If you happen to be one of those persons whose intestinal bacteria do react to beans, you might try any of the various enzyme products that can be added to beans during cooking that “pre-digest” the carbohydrates and help reduce flatulence.