Many types of snakes live off of rodents, so if you have a lot of rodents in your yard, you’re also likely to have snakes there hunting them. Get rid of the rodents and you will most likely get rid of the snakes. There are traps and pesticides that you can use, the choice is really up to you, just be aware that rodents can be very good at figuring out how to overcome your traps, so you need to be smarter than them.
When it comes to shelter, keeping your lawn cut short will deny the snakes a good hiding place, and that can discourage them from getting into your yard. They also enjoy the heat from the sun in rocky areas, so if you can remove piles of rocks near your home, you will deny them an ideal place to live.