Keep foxes away with motion-activated lights and sprinklers. You can also repel them with a homemade fox repellent spray of chili powder and water or chili pepper, vinegar and raw garlic.