If you grow it, they will come. Critters don't understand property rights. Gardens are often and disastrously lost to predators unless the owner takes garden defense seriously. Identify the predator, or potential predator (the one that gets into the neighbor's garden). Then act to prevent the problem, or you'll risk losing what you're working so hard to grow.
One general deterrent for deer, dogs, cats, and raccoons is the "garden cop," a sprinkler that sprays 3- to 4-second bursts of water when its electronic sensor detects an animal (or person). After squirting, it automatically shuts off and continues to scan the area for the next perimeter violation. "Garden cops" connect to your garden hose and are available from garden suppliers.
Birds, wild or tame, love to eat corn, bean, and pea seeds right after they sprout and before these plants are up a few inches. If birds are a risk, plant the seed extra deep and don't leave any showing. Firm the planted kernels so they stay down there until they germinate. A well-made scarecrow that moves in a breeze may keep them away, especially if it wears real people clothes, has shiny foil hanging strips for "hands," and has a foil face.
Gophers make a horseshoe-shaped mound with an exit hole on one side. A wide variety of traps, poison gases, and poison baits are available from garden supply companies to deal with gophers or moles. Or you could try chewing gum. Dig down to a part of the hole under the mound. Unwrap the gum (don't touch it and leave your scent), and puts 2 sticks down in the hole. Use large leaves (or paper) to cover the hole where he dug down, and puts dirt on top of that. (Block the light, but don't cover the gum with dirt.) Only one kind of gum works for this. It's "juicy" and "fruity."
Slugs and snails will eat stalks and leaves of tender plants. A thick growth of prostrate rosemary makes a border they will not cross, seeming to dislike its sharp foliage. To collect them, put out a saucer of beer, or of milk mixed with water, set down into the ground so that the dish's edge is at ground level. They'll crawl in and drown. Or save eggshells, dry, and finely crush. Then sprinkle them on the garden ground where the slimers go. The shell fragments stick to them and kill them. Don't use the salting method of slug murder because salt kills both slugs and garden veggies.