Constipation can be an uncomfortable problem to have. But many people experience it from time to time, especially while pregnant or taking certain medications.

There are many potential causes of constipation. There are also many treatment options. Adjusting your lifestyle habits or reaching for home remedies may be all you need to treat occasional constipation.

Take the time to learn about some of the best natural remedies for constipation.

Staying in bed all day may seem like a nice way to spend a lazy Sunday. But skipping your morning bathroom break can lead to problems.

Not going to the bathroom regularly can cause your stools to harden and your intestines to slow their motion. Try to go to the bathroom before bedtime and first thing in the morning. Not everyone needs to go at these times, but following a regular schedule can help. You may be able to ward off future bouts of constipation by getting up and moving around at the same time every day.

You might not feel like taking a trip to the gym when you’re backed up, but exercise may provide the relief you need. Going for a walk or run, for example, can help stimulate the muscles in your intestines and colon. Any physical movement helps the bowels move things through.

To help prevent and relieve constipation, make exercise a regular part of your routine. Aim for at least 150 minutes of moderate aerobic activity per week. That’s equivalent to 30 minutes of aerobic exercise per day, five days a week. If that seems like too much for you, set a smaller goal to start. Try to get some physical activity every day to stay regular.

Drinking enough fluids can also help prevent and treat constipation. It can help move food through your digestive system and stop stool from hardening.

In general, you should aim to drink about nine cups of liquid a day if you’re a woman and 13 cups if you’re a man. If you’re constipated or taking fiber supplements, you may need to drink more. Ask your doctor for guidance.

Though water is an ideal choice, don’t discount the benefits of other beverages. Green tea, black tea, coffee, and other drinks can all count towards your daily fluid intake.

Getting enough fiber in your diet is crucial. There are two main types of fiber: soluble fiber soaks up water, which helps keep your stool soft; insoluble fiber adds bulk to your stool, which helps it move through your digestive system faster.

To help treat mild cases of constipation, try eating easy-to-digest foods that are high in fiber, such as berries, bananas, prunes, or avocado. To prevent future problems, include plenty of fiber-rich foods in your diet, including vegetables, fruits, and whole grains. You may also benefit from a daily fiber supplement, such as psyllium husk (Metamucil).

Getting enough magnesium in your diet might also help relieve constipation. Oral magnesium supplements function as osmotic laxatives. That means they pull water into your digestive system, which helps soften your stool.

You can purchase magnesium capsules at health food stores and pharmacies. You can also get magnesium from food sources. Talk to your doctor before talking magnesium if you have a history of kidney problems. Conveniently, most foods that are high in magnesium are also high in fiber. For example, whole grains and dark leafy greens are good sources of both.

According to Dr. Arielle Miller Levitan, an Illinois-based internal medicine specialist, eating a tablespoon or two of coconut oil each day might help lubricate your intestines. In turn, this may help prevent constipation. Ask your doctor if this remedy might work for you.

If the idea of swallowing a spoonful of coconut oil doesn’t appeal to you, there are other ways to add it to your diet. For example, you could mix it into your morning coffee or blend it with vinegar for a simple salad dressing.

The next time you feel a little constipated, try these home remedies. They may be all you need to get your bowels moving again.

If these remedies don’t work, or you find that you’re chronically constipated, talk to your doctor. They might recommend lifestyle changes, medication changes, or other treatments. In some cases, chronic constipation is caused by another underlying health condition. Your doctor can help you identify and treat the cause