You may find many brands of squirrel repellent available. The best of these make use of the animals sensitive nose to drive them away without harming them. Especially effective are repellent that use either Thiram, capsaicin, or mustard oil. These can be sprayed onto both plants and objects to keep squirrels away.
All of that may be helpful, but what do you do in a worst case scenario? As stated before, squirrels are largely afraid of humans and will avoid contact. It is rare for one to enter the living areas of a home. However, it does happen occasionally. I remember a time when my roommate was home alone. He like to smoke but hated the smell, so he would leave a window open. Often he would fall asleep without closing it. We lived in an urban area, however our apartment complex had trees scattered around the property and, lo and behold, my brother awoke to find a squirrel inside the house.
No matter how great your discomfort, a squirrel trapped inside a room filled with large, loud humans is probably even more scared. It’s likely downright terrified. The smart thing for my brother to do in this scenario would have been to leave the door and window open and leave the squirrel alone for a few hours, perhaps even leaving the house. Once it had calmed down, the squirrel would have likely found it’s own way out once it was no longer too scared to think.
Not knowing this, my brother kept the doors closed and attempted to urge the squirrel back towards the open window.
Panicked animals do not think rationally, however. Instead the squirrel went straight forward, hoping to zip past him and find somewhere to hide. When it couldn’t it began darting back and forth across the room in a frenzy, my brother trying to chase it back out the window. All the while the squirrel was defecating leaving quite a mess all over the living room. After an hour of this my brother finally gave up and went back to sleep. After watching him for some time the squirrel decided it was not, in fact, a clever trap. It then proceeded out the open window of it’s own accord.
If the same happens to you and there is no clear exit in sight, use some peanut butter to set a humane trap. Once the squirrel is caught, release it outside the house and let it find it’s own way home.