Grabbing a pair of earbuds has become a habit for smartphone users who want to talk hands-free, listen to music, or otherwise enjoy some level of privacy. But regardless of whether you’re wired up or use AirPods, you will eventually come to a startling conclusion: Earbuds can evolve into something utterly disgusting.

Earwax, bacteria, and other contaminants can essentially turn them into a Petri dish you continually shove in your ears. Debris can also impact sound quality as your body grime clogs the speakers. Fortunately, there are ways to get this indispensable phone accessory clean.

For most earbuds, including wireless AirPods and other brands, it’s best to take a moistened (not wet) cloth and give them a good wipe, followed by a lint-free drying cloth. That will get rid of most surface gunk. You can follow up with a Clorox wipe or alcohol wipe to kill any germs, and then dry them again. You’ll want to make sure the earbuds are totally dry before putting them back in their protective casing.

The speaker mesh shouldn’t get damp. Instead, try using a cotton swab to clean over them. You can do the same for any attached microphone. If the earbud piece (tip) that rests in your ears is removable, you can take it off to get to the grime underneath and even run the plastic piece under water once it’s separated from the earbud itself.

You can also purchase a specialized cleaning tool to remove wax if you have trouble getting to it with a cloth. Just be sure not to use anything with a stiff bristle, as that can scratch or otherwise damage the equipment.

Any charging contacts on the charging stations should always be cleaned with a dry cloth, as dampness can lead to corrosion, which can lead to having to buy a new set of earbuds.

Bear in mind that not all manufacturers recommend chemicals for cleaning. Samsung, for example, recommends dry wipes and swabs only for their Galaxy Buds line of earbuds. Google also advises users to skip chemicals for their Google Pixel Buds, too, though a barely-wet cloth is OK.

It’s a little hard to practice preventive measures on earbuds. If they’re in your ear, they’re bound to get dirty. But if you’re a gym-goer and know you’ll be sweating into them regularly, you can grab a silica gel pack like the kind found in consumer product boxes and stick it nearby. That will absorb some moisture and help keep your buds dry.

How often should you clean them? It depends on your use. Earbuds worn every now and then only need to get wiped down sporadically. If your buds are a daily accessory, try an evening wipe down and a full clean every week or two.

[h/t Gizmodo]