When a cat stops using their litterbox they should always be seen by your veterinarian. It is possible that it could be caused by a medical issue and quickly resolved. If it is a behaviour reason, the faster you start to figure things out, the higher success rate of stopping the unwanted behaviour.
Here are some conditions studies have shown cats prefer,
1. Litter box should be as long as the tip of their nose to the end of their tail
2. No cover
3. Use clumping and unscented litter
4. Scoop that box at least 2 times a day!
5. Clean the litter box with unscented cleaners
6. How many boxes? One litterbox per cat plus one additional
7. Place the litterbox in low, easy to access area with lots of privacy