It is normal for people to have flatus, also knowing as gas. People pass flatus many times per day. It is made by bacteria that is breaking down the foods that pass through your colon. It is a natural and normal process that all humans and animals go through. There are definitely foods that create more gas such as the ones you mentioned. If you have an abnormal amounts of gas that is causing difficulties in your life, you should make an appointment with your primary care doctor
to discuss your symptoms. People who pass flatus could have constipation. If you are constipated, the stool is obstructing the colon and gas can build up. If you are constipated, you should eat more foods with fiber so that the stool can pass easily through the colon without preventing the gas from forming behind it. You should also keep in mind if you have any trouble digesting foods such as milk. People who are lactose intolerant cannot break from the lactose that is found in milk and can lead to a lot of gas. You should keep a dairy of foods that you eat and your response to them and then go over it with your doctor. Again, please speak with your primary care doctor.