Too keep squirrels out of your garden first make sure there's nothing on the ground that the squirrels want to eat such as nuts, seeds etc.
The squirrels will be less likely to go to the areas and stay out of the garden if there is nothing in the garden that the squirrels want.
You can also place mothballs in your garden near the plants or around the perimeter of your garden to keep the squirrels out of the garden.
Also placing coffee grounds around the plants can also deter the squirrels because the squirrels hate the aroma or scent of the used coffee grounds and will stay away from the garden.
Coffee grounds are also useful for providing the plants in the garden with nutrients and acid that most plants like and they'll grow better.
Just don't put too much coffee grounds in the soil or the plants will get too much acid which can kill them.
Spreading mulch around the garden also helps to keep squirrels away from gardens.
Another option is to plant a live peppermint plant in your garden which will also repel the squirrels because the squirrels hate the peppermint smell.