So one way to discourage snakes is to try to eliminate the food supply. Snakes will eat things such as mice, insects and slugs. Some also eat frogs and earthworms. But the last two, in particular, are helpful to gardeners. Frogs eat insects.
Earthworms improve soil.
Please remember that snakes are beneficial, so try to avoid harming nonpoisonous ones. Many snakes are actually protected by law. The Texas Parks and Wildlife Department can provide further information. As the weather warms, snakes begin to move about. Remove piles of brush or lumber, tall grass and any other good hiding places or sheltering habitats for snakes in your garden.