One of the easiest, least detrimental means by which to protect any garden is to encourage a healthy mix of flowers and herbs around your vegetables and fruits. This naturally strengthens their resistance to certain pests and disease while also improving yields, and is commonly known as intercropping.
Intercropping has been practiced since ancient times and one key to the technique is pairing ideal companion plants. In tandem, certain varieties of plants are capable of both attracting beneficial insects while also confusing and repelling pests from their intended host plants. As an example, when inter-planted with cabbage, onions and cucumbers, dill can simultaneously attract hoverflies and wasps while repelling cabbage looper and aphids. Likewise, alliums like garlic and leeks make an ideal companion plant to carrots by deterring destructive onion and carrot root flies. Other popular varieties with deterrent properties include geraniums (Japanese beetles), chives (aphids), mint (ants and mice), chervil and radish (which serve as effective trap crops to protect nearby vegetables from slugs and beetles).
Larger invasive pests like deer stay away from eating foliage that is hairy or fuzzy (Siberian bugloss, lambs ear, poppies) and, understandably, also prickly or fibrous (look to iris, globe thistle and peonies, just to name a few). Deer also dislike heavily-scented plant life, making most herbs (including sage, lavender, rosemary and oregano) perfect companion plants for a successful garden. If deer and rabbits are being especially persistent and your garden has room to spare, consider growing some of their favourite fare like alfalfa, clover and lettuce as sacrificial crops set well away from your intended, protected plants.