Mothballs are those funny smelling things that are typically encased in a plastic container and hung in the closet to ward off moths and silverfish. Earlier mothballs were made with naphthalene, which is a crystalline, solid hydrocarbon. It has a pungent smell and a flammable nature, which is one reason it is no longer used in making mothballs.

...
How Does a Mothball Work?

1,4-Dichlorobenzene

1,4-Dichlorobenzene replaced naphthalene as an ingredient in mothballs. It is an organic compound that is a colorless solid with a scent similar to camphor. Both the naphthalene and 1,4-dichlorobenzene have strong unpleasant odors. Both help to kill moths and the larvae by the chemicals' potent fumes. 1,4-Dichlorobenzene and naphthalene are solids that transition to a gas that is toxic to moths.

Toxic Fumes

In order to work, the mothballs are confined with the clothing, allowing the fumes to build up and kill the moth or larvae. Before wearing the clothing, the fabric should be thoroughly aired. This is especially true for infants or small children who are especially vulnerable to the fumes. Mothballs are a carcinogen, and their fumes should not be inhaled by humans or pets because they can be deadly.

Poorly ventilated rooms where mothballs are in use can be especially hazardous. Extended exposure to mothball fumes can result in irritation to the throat, nose and lungs, along with headaches and confusion, as well as depression or aggravation. Long periods of exposure can result in kidney and liver damage.

Negatives

Is the cure worse than the ailment? This is a question one might ask when using mothballs to ward off pests. While the moths feed on cloth, what harm can the mothballs cause? The pungent and overpowering fragrance from mothballs can result in a lingering scent that is difficult to remove. If children or pets come in contact with the substance, by touch, ingesting or inhalation, the consequences can be deadly. If eaten, the poisonous mothballs can cause seizure within 1 hour.