If you want to get rid of cats in your yard, you have two options: natural or chemical methods of humane animal control.
You can buy cat repellent sprays in hardware stores. However, these are not long lasting solutions, as the chemical usually washes away in a rainshower.
There is nothing worse than finding that stray cats have messed in your back yard. However, you can solve this problem without resorting to chemicals.
For example, cats do not like surprises. Setting the water sprinkler to random will provide an effective deterrent. Also, cats do not like walking over unpleasant surfaces. Wrap some tape around the fence or gate post they use to access your garden. The emphasis here is on an unpleasant texture for the cat's feet - not causing the cat pain in any way.
Certain plants can get rid of cats. Rue is an herb they particularly dislike, but handle it with care, as it can cause irritation to human skin.
If the cat is a regular visitor to your garden and seems well-nourished, it probably belongs to one of your neighbors. Try to find out who owns it and discuss the fact that the animal has become a pest in your garden. On the other hand if the cat is obviously a stray, call the pest control authorities and see if it can be removed.