There's no single diet or medicine that works for everyone with IBS. But there are lots of things that can help if you have been diagnosed with it.
cook homemade meals using fresh ingredients when you can
keep a diary of what you eat and any symptoms you get – try to avoid things that trigger your IBS
try to find ways to relax
get plenty of exercise
try probiotics for a month to see if they help
do not delay or skip meals
do not eat too quickly
do not eat lots of fatty, spicy or processed foods
do not eat more than 3 portions of fresh fruit a day (a portion is 80g)
do not drink more than 3 cups of tea or coffee a day
do not drink lots of alcohol or fizzy drinks
If you keep getting diarrhoea, make sure you drink plenty of water to avoid dehydration.