Litter box problems are probably the top behavioral problem people have with their cats, aside from the unwanted scratching of furniture. Cats are finicky creatures, not to mention they often will decide not to use their litter box if they are sick or in pain. Determining why they aren't using the litter box is usually the first step before you can decide what to do about the problem.
Someone posted on this blog the other day with a question about a couple of accidents their cat had. In their case, the accidents were easily explained, because the cat was physically blocked from getting to her litter box all day. So if your cat is having accidents, the first thing is to make sure he or she can actually get to the litter box. If, say, a door that is usually kept open is shut, or if another pet in the house is preventing your cat from getting to the litter box (as my younger cat sometimes does to my older cat), they may have an accident not because of any behavioral issue, but because they truly just couldn't get to the litter box in time.
Another common reason why cats have accidents is because they are hurt or sick. The usual suspect is a urinary tract infection -- a cat with a UTI or another physical ailment will often pee in a different spot every time. Whether it's because it hurts and they are holding it too long or trying to find a place to relieve themselves where it won't hurt, or they are trying to tell you something is wrong, a cat that is going to the bathroom all over the house usually has something physical wrong with him or her.
Another thing that can cause a cat to relieve itself outside the litter box is a dirty box. If your cat is having bathroom problems, you might want to add more litter boxes (especially for multiple cats) and clean them more often. Also, if you have changed the kitty litter to a new brand or type recently, change it back! Dirty litter boxes and "weird" kitty litter can cause a cat to start finding other places to do their business.
True behavioral issues are typically easy to spot because the cat tends to go in the same place every time. It may be because that spot has started smelling like cat urine, or just because it has become a habit. (And no, many deodorizers don't work -- they cover up the smell as far as we can tell, but the cat, whose sense of smell is much keener than yours, can still smell it. Cleaning the spot well enough so that not even a molecule of urine is left is often required to get the cat to stop, and even then, you might need to replace the rug or furniture she's peeing on, or rearrange so that she can't access the spot anymore.
Your best bet: If your cat is having litter box problems, always try to determine the reason why, as it may affect what needs to be done to get them to stop. Rather than discipline or being confined to the garage, they may only need a cleaner litter box, one that is easier to access, or even a trip to the vet to resolve the problem!