Though usually diet
related, other causes are medications (narcotics) or (less commonly) hypothyroidism
The first thing you should do is evaluate how much water you are taking in a day (>8 cups/day) and how much fiber
you are eating (25 to 35 g/day). If that doesn't work, look to see if you are taking too many constipating foods like dairy or pasta.
Answer assisted by Tejas Ozarkar, Medical Student