I am giving you some tips to prevent constipation:
1. take 6-8 glass of water in a day
2.Regular Physical activity
and active will greatly reduce your risk of getting constipation.
Ideally do at least 150 minutes of physical activity every week.
3.You should have about 30 g of fibre a day.
You can increase your fibre intake by eating more:
I am giving you list of some fibre containing food
whole wheat pasta
Never ignore the urge to go to the toilet
Consult Physician for Further Management