Did the neighborhood stray cats pick your yard for their favorite bathroom? Most local laws allow cats to roam free, and it is a crime to harm them. Here are many suggestions that you can try. What works for one cat, might not work for another so be prepared to try more than one solution. Good luck!
Scatter orange and lemon peels (cats dislike citrus smells), cayenne pepper, chili pepper flakes, coffee grounds, pipe tobacco, lavender oil, lemon grass oil, citronella oil, peppermint oil, eucalyptus oil, or mustard oil.
Scatter pinecones in the areas. Ponderosa or other prickly cones work best.
Buy a commercial cat repellent and scatter or spray it in the places where the cats are doing their business.
Install a motion sensor sprinkler that will startle them, and move the sprinkler around your yard every few weeks. You can get even get one that looks like a scarecrow.
Place plastic forks into the ground with the tongs up. Or use chopsticks.
The Coleus-Canina plant is known as the "Scardy-Cat" or "Pee-off" plant because it emits an odor offensive to cats but not to humans and deters their presence. Buy from a nursery and plant in your yard.
Put down chicken wire - cats hate walking on it.
Plant green onions every 5 feet around your garden.
Put a Scat Cat in your yard. It has reflective eyes that will scare a cat.