Snakes are attracted to a number of things. They eat mice and rats, but they also eat discarded birdseed and fruit. If you have a compost bin, ensure it’s completely sealed. If you have bird feeders in your yard, try to keep them at the perimeter of your yard and as far away from your home as possible.
A super simple way to deter snakes is by planting lemongrass in your garden. Snakes hate the citrusy smell and thankfully, so do mosquitoes!