There are two common types of fiber, soluble, and insoluble.
Soluble fiber absorbs water and turns into almost a gel type substance when water is added. So if you have diarrhea this is the type of fiber you want to concentrate most on having in your diet. This can be done by using foods such as rice, potatoes, ect. This can also be achieved by using a fiber supplement. If you are going to use a supplement(which you should use both a supplement and food) then you need to start gradually by using 1/6 of the daily recommended dose each time 3 or 4 times per day(morning evening, and once or twice with big meals). If you jump in all at once and your body is not used to having the fiber then you will most likely run into the opposite effect. It will give you MORE diarrhea.
TIP-Remember soluble fiber is water soluble so there must be water in your diet equation. try drinking 7-10 8 ounce glasses per day. Spread the water out and don't drink within a half hour of each meal. The water can dilute your digestive enzymes and you don't want that.
Insoluble fiber is just the opposite of soluble, it is not water soluble so for those of you that are having constipation then you need to try to incorporate more of this in your diet. Don't worry this is very easy to do. Almost all Green veggies have insoluble fiber as well as nuts and legumes. You can find full lists online.
SOMETHING TO REMEMBER- You MUST have both types of fiber in your diet. It is like a balancing act. You have to find the right soluble to insoluble ratio for you and try to stick with one that gives you 1-3 good bowel movements a day. Don't give up because this can take some time. Increase you dose 1 time per week until you reach the full daily 20-30 grams of total fiber usually closer to 30 is better.
TIP- If you find yourself going pee alot with drinking all this extra water try two things. Do some kind of exercise for 20-60 minutes per day. Usually starting with light stretching or yoga is good. Also put just enough celtic sea salt in your water that you can't taste it too much. This will slow the movement of water through the body because your body will try to extract all the minerals from the water. ALSO get your sleep 8-9 hours per day if not more will help in fighting ibs.
ANY QUESTIONS OR NEED MORE TIPS JUST ASK IN THE COMMENTS