As I read online, You can repel squirrels using scents they hate such as, capsaicin, white vinegar, peppermint oil, coffee grounds, cinnamon, predator urine, garlic, dryer sheets, Irish Spring bar soap, and rosemary.
But for the squirrels in the yard, a well-placed trap, baited with some nuts works well.
Then relocate as required. One example I have seen is a long cardboard box, just large enough to accommodate the trap, with a porthole for a vehicle's exhaust.
Squirrel loaded john at one cabin with mushrooms and nice grass nest. I actually used scoop shovel to pitch them out into trees. Got to respect guy who works so hard, but thought some metal flashing might help discourage such a strong work ethic.
Squirrels scent trail each other. So if they are already in, you’re gonna get more.
I shoot em in summer and trap with 110s on all the surrounding trees once it’s cold enough. Since I started keeping the numbers in check they haven’t wrecked anything (that I know of).
They aren’t really smart enough to avoid predator scents. We had 9 feral cats move into the yard one time, 4 another time, the squirrels were still there - just noisier.
__________________
“Nothing is more persistent than a liberal with a dumb idea” - Ebrand