More commonly, a previously well-trained cat stops using its litter tray and chooses another location for its toilet, behind a sofa or in another room or beside the litter tray but not in it.
The most common reason a cat stops both urinating and defecating in its litter tray is because there’s no privacy, the tray has been moved or the type of litter has been changed. Some cats stop using it if it gets too dirty. Curiously, others stop using their trays if you’re too fastidious cleaning them! Cats hate their litter tray near their food. Moving the tray accidentally closer to food, simply to make more room for a dog bed as one of our clients did, can cause a cat to stop using its tray. In our experience changing the brand of litter is a more common cause. The feel under foot and the smell of the litter are both powerful reasons cats use a specific litter. Changing either, especially if you change from an unscented to a scented variety can trigger the abrupt stop in using the tray. What is needed in both these circumstances is a return to the former arrangements.
It’s more likely that a cat stops either urinating or defecating in the tray but not both. In these circumstances it’s very possible there is a medical explanation. The cat associates the pain or discomfort it feels (from sharp urinary crystals or bladder or urethral infection) when urinating, with the tray, wants to use the tray but in trying to avoid the pain urinates beside it. Similarly, pain from impacted anal sacs or constipation can, in the cat’s mind be associated with the tray so it defecates beside it. If you cat stops either urinating or defecating in the tray please arrange for one of us to see you and your cat.