For insoluble fiber, try whole wheat and wheat bran, nuts, seeds, and raw vegetables. Beans and peas contain significant amounts of both soluble and insoluble fiber. The bottom line: soluble fiber is good for both diarrhea and constipation. Foods high in insoluble fiber are best for constipation only.