Yes, vinegar can be effective in preventing snakes from your garden. You can pour white vinegar around the plants or any other places where you don't want the intrusion of these reptiles.  Note: It may not be very cost-effective if you want to spread it across a large area in the garden.