Repel the Pests. Keep slugs and aphids away from window boxes with a homemade, nonchemical pest spray. Place one peeled onion, two peeled garlic cloves, and one teaspoon cayenne pepper in the jar of a blender. Add three cups of water, and blend until smooth. Let the mixture sit overnight, strain the liquid into a spray bottle, and coat plants generously. The solution will keep, refrigerated in the bottle, for up to one week.