
Farting is usually caused by one of two things:
1. Air that you swallow when you eat your food
2. Rotting, incompletely digested food in your digestive passageway
The first produces the innocent but often noisy and loud flatulence which carry no objectionable aroma. It is embarassing due to its violent albeit harmless sound. The second produces the kind of fart that affects people around you in a negative way - offensively pungent.
The first one is usually hard to avoid and is typically normal. It's air you end up swallowing as you go about your daily routine. Just try to keep it as quiet as possible by letting it out in small streams or retreating to an unoccupied room during execution.
The second one is a bit more complex but can be avoided and remedied with several solutions. Like many health porblems, excessive flatulence can be avoided with proper diet:
1. Chew your food properly. The digestive organs do find it hard to process large chunks of food. If you let your teeth do its job and process it properly before passing it on, the better job of digestion you are likely to achieve.
2. Avoid food that give you constipation or stomach troubles. They will be the ones that give your digestive system the hardest time. Avoid them and you just might see your farting problems go away. This includes all processed food, some worse than others. In general, you want to have a diet of natural, unprocessed items. While this may not be completely practical in today's world of generally processed diet, it will help you a great deal to minimize the "unhealthy" food as much as possible.
3. Rest after a big meal. Allow your body to digest food properly. If you get busy running around immediately after eating, you take a lot of needed resources away from the digestive passageways, denying it the ability to perform its function properly.
As a supplement to improving your food intake, you can use Anti-Gas medications that help provide better digestion, solving many of your gas problems.