If your cat normally uses a litter tray but has recently started to go elsewhere in the house there may be an obvious reason.
Litter Tray Too Dirty
Cats don't like using a tray if it is heavily soiled. Litter trays should be cleaned out every couple of days. If you have several cats provide one litter tray each.
Litter Tray Too Clean
Using scented litter, deodorants or disinfectants may put the scent sensitive cat off using the tray. Use a disinfectant, which is feline friendly and make sure the tray is rinsed thoroughly with water. Avoid disinfectants that turn cloudy in water as these usually contain phenols which are toxic to cats. Cats learning to use the tray may need to associate it as a toilet and too frequent cleaning may weaken this association.
Wrong Litter Type
Changing the consistency of the litter or to a scented type may put the cat off using it. Many cats prefer fine grain litter with the consistency of sand. If you want to change the type of litter you use, mix the new one in gradually over a week or so to gauge the cat's reaction.
Litter Tray Position
Place the tray in a quiet spot where your cat only has to watch in one or two directions at once rather than in the open or in a thoroughfare. Placing food near the tray will put your cat off using it. Put the feeding bowl elsewhere.
Litter Tray Type
If you use an open type of tray it may be worth purchasing one with a lid to provide security. An inverted box with a hole cut in it may suffice.
Bad Associations
Occasionally a cat decides not to use a tray because it has had a bad experience there. Perhaps it was cornered there to be given some medication or another pet or child when last using it has intimidated it. Repositioning the tray to a quiet spot and providing a lid for it may help.