Keep the litterbox clean.
Don't hesitate to use confinement. Keep the cat in a small bathroom where it has its food and littebox and don't allow the kitty any freedom into the rest of the house until he or she is using the litterbox 100% of the time. If the room is small enough most cats will use the box consistently after 3 to 4 days. Some cats have to be kept "in prison" for 2 to 3 weeks before the habit of using only the litterbox is restored.
Use a litterbox that is at least one and one-half times the length of the cat from its nose to the base of its tail.
Avoid covered litterboxes. If a cover must be used and there are multiple cats in the house, cut a second entrance into the box.
Avoid having the litterbox in a noisy, drafty, high-traffic area.
Provide at least dim light during the night.
If the cat is very young, old, or disabled, cut a low entrance into the box.
If the cat does not dig in the litterbox and cover its excrement, simultaneously offer two or more kinds of litter in separate litterboxes and keep a log of the cat's preferences. A number of different litters may need to be tried.
If there is a suspected history of learned aversion t the box, offer the cat a new litterbox in a new location.
If there are multiple cats in the household provide as many litterboxes at there are cats, plus one more.
Some cats benefit greatly from phermone diffusers. These diffusers plug into an electrical outlet much like a "Glade" or "Yankee Candle" scent diffuser and give off a phermone scent that is calming to a cat. You can't smell it but the cat can. We use the Feliway brand.
Place the litterboxes in multiple sites.
If there is a social conflict between any of the cats, address the conflict.
If the cat has long hair, trim the excess hair between the toes and around the perineum.
If anxiety is suspected, give the cat a break and offer anxiolytic medications.