Oatmeal is relatively safe to eat when having digestion issues because it is bland and non irritating. It has protein, good carbohydrates, and is low in sugar. Most importantly oatmeal has soluble fiber which studies have shown helps reduce diarrhea. It does have some insoluble fiber, though, which may make diarrhea worse if you have too much of it.
Sources