The best thing to do to prevent squirrels from eating out of your bird feeders is to keep them away from the beginning - once they become accustomed to food, they will be persistent at getting to it! There are a number of specialized feeders and baffles available that are considered "squirrel-proof."
I've never seen a feeder that works for us yet, but baffles have totally solved our problem. One effective squirrel baffle is shaped like a stovepipe and is placed on the pole portion of the bird feeder. This allows the squirrel to climb up the pole and into the closed pipe, but he can go no further.
The other type we use is similar to those collars that they put on dogs when they don't want them chewing at something that is healing. It's a cone-shape and it "clasps" together to be held on there.
There are some distance rules when placing your feeders and baffles or the squirrels will simply use their jumping and skydiving skills from the ground and air to get to the feeders.
The pipe must be at least 15 inches long to prevent the squirrel from climbing over it, and set at least 4 feet off the ground (to the bottom part of the baffle) to prevent the squirrel from jumping over it. The feeder itself must be placed far enough away (8-10 feet is recommended) from nearby trees, wires, buildings or any other objects a squirrel could use to jump on top of the feeder.
You could also stock your feeders with seeds that are undesirable to squirrels, such as safflower seeds that attract cardnals and grosbeaks, or niger thistle that attracts goldfinches and other songbirds. The only problem with that is that it limits the diversity of birds attracted and increases the cost of seed. Black-oil sunflower seeds will attract the most species and they are not an expensive seed.
Most wildlife organizations discourage the use of any capsaicin-based “hot pepper” powder mix which, although advertised as a “humane” repellent when mixed with bird seed, reportedly can make squirrels sick and may be irritating to the humans that handle it, not to mention who might come into contact with it on the ground.