A cat accessing a kids' sandbox can transfer disease-causing parasites from its feces to the children who play there. Fortunately, there are multiple ways to keep cats out of a sandbox without harming the animals.
The easiest way to keep cats out of the sandbox is to cover it when it's not in use. This will also help prevent rain, snow and debris from being swept into the sandbox.
If your cats or feral ones are very persistent in trying to enter the sandbox, put up a fence around it. Make sure that the fence is cat-proof, such as using chicken wire or garden fencing designed to deter wild animals. Alternatively, you can use a motion-activated sprinkler system that sprays water near the sandbox when a cat is detected. The sudden splash of water will scare the cat away from the sandbox.
Another option is to spread cat repellents around the area of the sandbox. Commercial products are available, or you can make your own from ingredients like onion powder, garlic powder, coffee grounds, pipe tobacco and orange or lemon peels. Liberally scatter the items around the sandbox, and repeat this at least twice a week to ensure that the scent dissipates.
A motion-activated ultrasonic sound device can also be used to deter cats from the sandbox. This equipment emits a high-frequency sound that only the felines can hear, and when they come within range of it, the cat is startled and moves away.