I used to suffer from constipation. I used to go for days without a bowel movement, then had to really struggle and strain for my next bowel movement resulting in hard stool (feces). Then may follow increasingly loose stool. Then the next cycle repeats again - many days with no bowel movement, strain hard, hard stool followed by loose stool. The way I broke the cycle is to really increase my fiber intake, eating lots vegetables and fruits plus drink sufficient water.
Not to be forgotten is the need to go immediately to the toilet the moment you sense something in your rectum or you get the urge to defecate. Try your best not to postpone going to the toilet.
Then slowly my bowel movement began to become more regular and easy. For months now I no longer suffer from constipation.