Motion-activated sprinklers are an effective way to keep stray cats out of your yard, according to the ASPCA. When cats get too close to the sprinkler, they're hit with a blast of water that scares them off. Place the sprinklers in areas of the yard you want to protect.
Motion-activated ultrasonic devices are another effective option. Set off by movement, these devices emit a high-frequency sound that irritates cats but is inaudible to humans. Another option is to place chicken wire over garden soil to make it uncomfortable for cats to walk on. Additionally, placing prickly pinecones on the ground discourages cats from traversing over planted areas.