Snakes have been either worshipped or reviled since ancient times. Yet if snakes are in your home environment, be it the bedroom, bathroom or yard, they may make you uncomfortable and therefore could be considered a pest even though they may be keeping down the local population of rodents, lizards and insects.
While in general, the odds of dying from a snake bite are lower than being struck by lightning, about a dozen persons die in North America every year from snake venom. Herpetologists say that usually snakes will not bite unless cornered, handled or stepped-on and that the primary use of venom is to subdue prey, while defense needs are a distant second. So, if you sight a snake and it does not appear to back away, back away yourself keeping your eyes on it until you are at a safe distance.
It is not within the scope of this site to give medical advice but if you are biten, try to be calm, wash the wound area with soap and water, cover it and keep it lower than the heart. Seek medical attention immediately. Absolutely, do not use ice nor tie on a tight tourniquet above the wound site.
Above all else, if you live, work, camp or play in snake-prone areas, learn which snakes are dangerous, what they look like and what habitats they prefer. Some snakes lay eggs, others carry eggs that hatch inside the body. My family once found a 4 foot(1.2m)long skin on the kitchen table of my mother's mobile home which had been shut up for a while and needless to say, no one slept very well that night. Another time, we found that a snake had swallowed the light bulb kept in the laying box meant to stimulate the hen to lay eggs. No, we did not pull its tail to see if it would light up.
Depending on the locale, maintaining a snake-free environment may neither be advised or possible, but keeping grass and weeds low, trimming shrubs, removing piles of rubbish, rocks, logs and boards, stacking firewood off the ground, covering compost piles and removing bird feeders will help keep down populations of rodents, frog and lizards which are prime snake prey.
There are no proven commercial snake repellents however experiments using a Napthalene and Sulfur combination have shown promise.