Answer first: constipation here is predominantly a reduced-intake problem — less food, less fibre, less fluid — before it is a motility problem.
Soluble fibre — psyllium, oats, legumes — holds water and softens stool. Insoluble fibre adds bulk and speeds transit. In slowed-transit constipation the soluble kind is generally the more useful of the two.
The underlying point is that red flags that change this from a management question to a clinical one: no bowel movement for several days with abdominal distension and vomiting, blood in the stool, or unexplained weight loss beyond what is expected.
The fibre-and-fluid relationship in functional constipation is established across intervention studies, and fibre without adequate fluid worsens symptoms.
Nothing here is medical advice.
Pain, distension and vomiting together are urgent. That is not constipation.