Echoing @kevinsky's answer: you need to figure out what the animal is. Just because they're getting in your yard doesn't necessarily mean they're climbing the fence. Many animals can fit through surprisingly small gaps in a fence (if a rodent's head fits, the animal fits -- chicken wire won't keep rats out).
If it is a squirrel or other small rodent (rat, mouse, vole, chipmunk), I doubt there's much you can do. They can squeak through nearly any fence, they can climb nearly anything, some rodents dig, and they can jump higher than you would expect. I could only suggest keeping outdoor cats... it seems to work for me, though the cats sometimes cause their own trouble in the garden.
If it is a skunk, woodchuck, rabbit, or similarly sized animal, chicken wire or welded wire fence will do the job. Be sure to bury a portion of the fence, angling it slightly outward to thwart diggers. I keep skunks and woodchucks out of my garden this way.
I haven't personally dealt with raccoons, but they are notoriously difficult. Based on what I've read and people I've talked to, I would probably combine the chicken wire/welded wire with a strand or two of electric fencing: one at about 6" height, and one higher -- I'm not sure if you want it at 12" or if it would be better along the top of the wire fence at something like 4-5' height.
If it is deer, you need an 8' high fence, or a strand or two of electric fence. Generally the advice I've seen is to have a strand at about 5' high.
If it is birds, experiment with scarecrow-type things. (E.g. an owl statue, or those big "eye" balls, or streamers, etc.)
There are other things you can do, I haven't tried these but I've heard varying degrees of success:
- Use fox (or other predator) urine to deter prey animals like deer.
- Motion-activated noise makers; or just a radio that stays on at night.
- Motion-activated lights.
- Motion-activated sprinklers that hit the animal with water to scare it away.
The problem with these kinds of solutions is that the animals will become accustomed to them. You can move them to different areas to prevent this, but over time a clever/hungry animal (raccoons) will find a way to get to the food.
Someone invariably chimes in on these questions with an answer that you should sit outside with a rifle and shoot the critter that is raiding your garden. Even if you're in an environment where this works (not the 'burbs), and you're a good shot, it's a pointless exercise. First, you're going to have to shoot every animal that wants to eat your garden, but they're like those zombie movies: they'll just keep coming, so unless you want to do nothing but sit on your porch with a rifle all the time, and eat possum stew every day, it's not practical. Second, many of these animals come around at night; shooting in the dark isn't such a great idea.
Catching whatever it is in a live trap is a poor idea for similar reasons. I'd also note from experience that it's hard to bait something into a trap when there's so much nearby good food to attract it elsewhere.