Both mothballs and ammonia are an effective way of keeping squirrels out of an attic. In each case, the material must be carefully placed in order to be both effective and safe for the user.
Individuals must ensure that the entry door to the attic is tightly sealed and no exits near it lead inside the home. Users should wear a mask and gloves while placing ammonia or mothballs in the four corners of the attic as well as known locations where squirrels are living. Any pans should be half-filled with ammonia or mothballs, and other areas can be covered with ammonia-soaked towels or mothballs. Be sure to leave the squirrels an escape route so they can run away from the smell.