Constipation is often noticed when a cat strains, passes small amounts of hard, dry stool or does not pass any stool at all. Dehydration, pain, previous pelvic injuries, neurological problems and other diseases can contribute. With long-lasting or recurring problems, the large intestine can widen and develop megacolon.
It is important to tell constipation apart from difficulty peeing, because a cat with a urinary blockage can also sit in the litter tray for a long time and strain. So check whether urine and stool are actually coming out. The vet may need to feel the abdomen, assess hydration and sometimes take X-rays to see how much stool there is and whether the pelvis or large intestine has changed.
Contact a vet if your cat strains without result, has not passed any stool, vomits, loses its appetite or seems to be in pain. Do not give enemas or laxatives meant for people without a vet's instructions.