Many DIY solutions are available for repelling snakes, including planting lemongrass and garlic or spreading essential oils. Other DIY prevention tips include keeping your lawn mowed, weeding your garden, and trimming your shrubs and trees.