What you eat plays an enormous role in managing digestive symptoms. But many foods are specific to conditions and 'generic' advice can be contradictory. But certain themes like eating plenty of fibre, complex carbohydrates, drinking plenty of water and having a good intake of raw/lightly cooked green vegetables and fruits are key to a health digestion.
Please see specific articles for diet advice.
Diet advice for heartburn (GERD)
Diet advice for flatulence and gas
Diet advice for a stomach ulcer