Flatulence is the expulsion through the rectum of a mixture of gases that are byproducts of the digestion process. Therefore, "farting" is influenced by what you eat and when you eat it. For example, it is well-known that you are going to "fart" if you eat lots of beans, as well as potatoes, corn, noodles, wheat and mostly all sort of starched, because of the substances they contain. "Fart-safe" foods are, for example, cooked vegetables.
Among the remedies to farting are eating cumin, coriander caraway, yogurt or taking a medicinal activated charcoal (like CharcoCaps).
Also, it is absolutely necessary to defecate every single day.