Cats actually learn to relieve themselves in certain areas and substances, (be it sand, dirt, clay or wood chips) as long as it is clean. Including an older cat, preferably a female cat, in the household allows young cats to easily learn what's done where.
Cats have an incredible sense of smell, and the litterbox you think is clean may be revolting to them. If you have ever lived with someone who is messier than you are, you can understand the problem.
Try following these general guidelines:
1. Get one more litterbox than you have cats. This allows a fussy cat to defecate in one box and urinate in another. Because cats naturally use their waste to communicate in different ways and excrete at different times, two boxes can better meet fussy cats' needs.
2. Scoop the litter two to three times daily. Dump the litter and wash the box at least once a week. If the box is scratched, throw it out; old litter and boxes that look clean to you can stink to the cat.
3. Provide appropriate-size litterboxes. The box needs enough depth for your cat to dig, with sides that are low enough for even your tiny, young or arthritic cat to step over. Select a box that measures at least 1 1/2 times the length of your cat.
4. Find a litter that your cat likes and use it. Cats dig where they like; if your cat digs into your bathmat but not in its litter, look for a litter that feels similar to the bathmat. Your cat will let you know if it approves.
5. Avoid frequently changing the types of litter used.
6. Ventilate covered litterboxes and clean them daily. Think of a public toilet without fans or windows to understand your cat's perspective.
7. Keep cat food away from the litter and put the litterbox in a place where the cat is comfy and likely to be undisturbed.
8. Restrict the cat to a smaller space, like a bathroom, and provide plenty of attention until it uses the box regularly.
9. Finally, use a good stain and odor eliminator on the inappropriately soiled areas. Use a product that both enzymatically breaks down the urine and binds its compounds so that they are too heavy for the cat to inhale. First, rinse with club soda. Then blot. Repeat as many times as you can. Then use the stain and odor eliminator.
If you address toileting issues when they first arise and do not assume that (a) the cat will catch on by itself, (b) the cat is just being spiteful or (c) that the cat isn't "trainable" the trifecta of incorrect myths you'll be on your way to meeting your cat's needs and communicating well with it. And communication is really what urine and feces are all about in a cat's world.