Place several ceramic dishes of food for the squirrel with 1 to 2 feet of your corn, all around the area that it is planted in. If given the option for an easily accessible meal, they will eat that rather than the seeds that they need to dig up. Squirrel feed is available at home improvement and pet stores.
Sprinkle a synthetic squirrel repellent over the planted corn seeds. This repellent consists of scented granules that are designed to look like the detritus left by other animals. If the squirrel thinks that another animal has already marked your vegetable garden as its own territory, it will not go near the corn seeds.
Place several moth balls in a mesh bag and anchor it to the ground right next to your corn seeds. Put one bag on each side of the garden plot. Squirrels do not like the smell and will avoid the area.