How to Keep Squirrels Away?

I have had this problem and tried ALOT of stuff that didn’t work well. They now make a one-way door to put at the point of entry in the attic. It’s kinda like a doggie door but the squirrels can go out but can’t come back in!