To avoid getting constipated:
Eat plenty of fiber. Good sources are fruits, vegetables, legumes, and whole-grain bread and cereal. Eat bran cereal or add bran to other foods.
Drink 1½ to 2 quarts of water and other fluids a day. (Note: Milk can cause constipation in some people.) Liquids with caffeine, such as coffee and soft drinks, can dehydrate you and may need to be avoided.
Exercise regularly.
Move your bowels when you feel the urge.