Cats may avoid the litter box for medical, behavioral, or environmental reasons:
Medical: Urinary tract infections, kidney disease, diabetes, GI parasites, or diarrhea.
Behavioral: Litter box aversion, stress, territorial marking, anxiety, or boredom.
Environmental: A box that is too small or covered, dirty litter, high-traffic or noisy placement, or too many cats sharing one box.
If the behavior persists, a veterinary check-up is recommended to rule out health issues.