For lots of people (including myself), a low-FODMAP (Fermentable Oligo-Di-Monosaccharides and Polyols) diet is a reliable way to eliminate painful IBS symptoms. The diet was developed by researchers from the Australia’s University of Monash, who discovered that IBS sufferers have trouble digesting certain kinds of food sugars. Those sugars are found in foods in varying degrees: for example, watermelon is high-FODMAP and cantaloupe is low-FODMAP. A complete list of high- and low-FODMAP foods can be found here.
The University of Monash has created a video to explain what FODMAPs are and how they affect the gut. The first 20 seconds of this video feature some laughably bad acting (you can skip the first 20 seconds), but the animation in the next 2 minutes is really useful.
Here's the article associated with the above video, which gives some additional info. You can also download a smartphone app where you can look up any food to find out whether it’s “safe.”
Happy eating, my friends.