Your first line of defense when keeping cats out of your garden is to make sure that you have your boundaries secure. If there are any gaps in your fence, you should make sure that you block them to prevent any low access. Cats are very agile animals, and can jump very high. Normally they can jump a fence, which is why you should also invest in string or taut wire across the top.
If a cat has made his way into your garden, it may be hard to get him out. Most people choose to use dogs, simply because dogs are known to dislike cats. There are several dog breeds out there that completely dislike cats, such as pit bulls and Dobermans. Cats are completely fearful of these breeds, and will flee if they see them around.
All cats are known to despise water as well. If you spot a cat in your garden, water almost always gets him out. All it takes is a bucket of water or a well aimed squirt with a garden hose to make him run away. After you have hit the cat with water several times, he should get the hint not to come back anymore. If he comes back, simply squirt him or throw more water on him until he gets the idea.
Protecting your plants is a different story. Mothballs are said to be very effective, as cats don't like the smell. You can use mothballs around your plants, garden borders, or even along the fence. There are other repellents that you can use as well, such as cayenne peppers, tobacco, lavender oil, citronella oil, mustard oil, and even lemon grass oil.
If you visit your local hardware or lawn store, you can find motion activated sprinklers. They work great in keeping cats out of your garden. Once you install the sprinkler system and a cat comes into the area, the detector will pick up the cat's presence and immediately shoot out a jet of water that will douse the cat. In most cases, all it takes is a few times of exposure to the sprinkler before a cat learns to stay out of that area.
Sound devices that feature high frequencies are also a great way to scare off cats, although they aren't annoying to humans. You can find several different models, such as those that stay on all the time, and those that are motion detected. To use this type of device, you'll need to make sure that the model you have is strong enough to cover the entire area. If you model you are using is strong enough to cover your entire garden, it should suffice in scaring off any unwanted animals.
You can also use commercial repellents as well. Commercial repellents use scents to keep cats away, and shouldn't be used near any food crops. Due to their high chemical content, commercial repellents can pollute your crops. You can find them at your local department store, with several varieties to choose from, many of which will fend off other animals from your garden as well.
If you have a garden, it can be very annoying if cats and other animals decide to make your garden their home. If you stick to your guns and do your part, you can prevent them from bothering your garden or your crops. Once you have secured your boundaries around the garden, you should try using water first. If water doesn't seem to work, you can look into another method, such as commercial repellents.