Answer: As you probably know, snakes are considered beneficial creatures, and many people try to encourage non-poisonous snakes to set up their homes near their gardens. Various snake species consume slugs, bugs, and even rodents. However, I understand how startling it can be to come upon a snake unexpectedly!
The best way to repel a creature is to first think about what environmental features it likes -- and then remove those. Snakes like to sun themselves, so try removing large, dark, flat stones that are sitting in a sunny spot. They also love to hide in damp, cool places like stone walls, so if you have one of these near your garden, that might be an attraction. A saucer of water can attract snakes, so any easily-reached pools of standing water may be attracting them. And some snakes use gopher tunnels as hiding places, so try ridding your yard of these.
Finally, realize that most snakes are your allies. By understanding their habits, you should be better able to be on the lookout for them so they won't startle you with their presence.
Q&A Library Searching Tips