Believe it or not, slugs and snails have a purpose, and it's not just to eat your lettuce. They provide an important service, and are a food source for many beneficial critters in your garden.
However, they could just as easily provide those services somewhere else, and leave your precious plants alone.
First, it's important to evaluate where you have the problem. Slugs and snails both prefer damp, cool shady spots, where they hide during the day, especially if it's hot out.
At night, they emerge to feed, and you'll know they've been there because of the slimy trails they leave behind.
Slugs are known as molluscs, along with snails, which are very similar but carry their house on their back.
The best way to deter slugs and snails is to make it uncomfortable for them, by spreading ashes around the plants they like the best. Sharp sand or lava rock works well too.
Apparently, slugs and snails refuse to cross or crawl over copper, so this would be something else to try - a piece of wire bent in a circle around each plant (as long as you don't have too many) will help.
If you grow vegetables in pots, raise them up off the ground with pot feet, to deter these guys as well as other pests from climbing up to the plant.
Remove any hiding places, such as boards placed directly on the ground. Clear out plants they hide under, if it's possible.
Whatever you do, don't put down metaldehyde bait. Other creatures (like dogs) eat it, and it's not a good way to die.
In the heat of the summer, avoid watering at night which makes it damp enough for slugs and snails to move around easily. If you water in the morning the moisture will have evaporated by evening.
We all like to use mulch to keep plants cool, but some of the worst offenders for attracting slugs are the best options for vegetable gardens; grass clippings, straw and chopped leaves.
Disturbing the mulch by tossing or raking and re-spreading it will help to encourage the slugs move on.
If you can, keep the area directly around the plant stem free of mulch to make it harder for the slugs to reach the plant and climb up.
Slugs are a food source for skunks, snakes and birds. Attract those animals to your garden, and the slugs and snails will make themselves scarce. Keep areas around plantings clear, but let twigs and other debris collect around the edges.