When it comes to how to get rid of squirrels from your attic, there are a number of measures that can be taken in order to get rid of them; One of the first things you should do however is to make sure a squirrel cannot make it way from the attic into your home if they panic they will take any route possible to escape including into and through your home.
The first measure to take is sealing all but one hole which you will be able to access (This will act as an exit for the squirrels, to be sealed up a little later when the problem is resolved), for example, cover chimneys with a wire mesh or chimney cap and repair any holes that the squirrels have made themselves. In terms of the exit hole, you should attempt to fashion a funnel out of wire mesh, wider on the inside end, narrower on the outside so that squirrels can find their way out, but not back in. If you’re unable to do this you can also buy spring-loaded trap doors which have the same purpose. When these steps have been taken, try and draw the squirrels out by placing food around the outside of the house, within good distance of your exit funnel.
If drawing them out isn’t viable for any reason, you can also try trapping them; There are many traps available but try and go for a smaller one and squirrels tend to injure themselves in larger ones when they panic. Placed out of the way with some appetizing food inside (Such as apple or peanuts) will ensure a good rate of success, when trapped simply relocate the squirrel(s) to a distance of around 10 miles so they don’t return. Rinse and repeat until all the squirrels are gone.
Repellents are also an option, from sound repellents such as simply leaving the radio on or a purpose-built ultrasonic repellent may work. Strobe lights can also be effective in scaring squirrels away, if neither of these work you can purchase commercial squirrel repellent which can be very effective.