Assuming they are not coming into your garden for food like rats and mice, then they are probably coming for shelter. Best thing you can do is to have a nice open front and backyard. Snakes love to hide so you need to remove any places they can lie low. So keep the grass mowed, make sure fallen leaves don't build up anywhere, quickly remove fallen branches, don't have any wood or rubbish piles, keep compost in a bin, and prune shrubs and plants so there's nowhere to hide underneath them.
I know there's also solar powered snake repellers that emit a sound or vibration that snakes don't like. Not sure about their effectiveness but could be worth a try. - Kermit
I have family that own farms and they have a few tricks to deter snakes.
Snakes are usually looking for water. So placing water containers in the corners of the yard can attract the snakes to one area, then you (or a snake catcher) can hopefully capture them and remove them from the area.
However a nice clean yard is the best defence against snakes. Remember snakes can also climb, so if you have things like bricks stacked against the fence this could be a good hiding spot for them. - kaylah_rose
Fake rubber snakes can deter some birds (not those that eat them like Kookaburras) but will not deter snakes and indeed may attract those that mistake them for a potential mate. Electronic snake devices do not work.
Other than having a pet mongoose, there is no way to repel snakes and as others have said all you can do is remove things that attract them like: long grass, thick undergrowth, piles of timber or bricks and other rubbish that they can hide in or under, and things that may attract rats and mice (aviaries, fruit trees, palm trees - rats love the nuts and fruit). - aussiblue