A proper cleaning tool can help get the gunk out of your headphones. Video: Caroline Enos

Clean the inside of earbuds with a small soft brush to remove debris.

Wax buildup can muffle the sound of your earbuds. Get an inexpensive cleaning tool designed for clearing out wax (some high-end in-ear models even come with one). First, pull the eartips off of the earbuds. Use the tool's metal loop side to gently scoop out any ear wax. Do not jam the loop into the tip while it's still on the earbud or you may push wax into the earbuds and damage the driver. Then use a small soft brush to gently clean off anything stuck to the earbuds. Wipe the eartips with a soapy wet cloth and dry thoroughly before reattaching to the earbuds.

After every workout, wipe gym headphones down, and allow to dry fully before charging.

Even if they're water- and sweat-resistant, don't keep your headphones wet for long periods because water can slowly seep into battery compartments or the earbuds themselves and short them out or damage drivers. (And even swim headphones should be allowed to dry fully before being put away.) Do not allow moisture into the earcup of over-ear headphones or into the nozzle of in-ear headphones.

If you need to take your headphones out mid-run or can't wait for them to dry completely before leaving the gym, gently shake out any excess moisture, turn the power off, and store them inside a little zip-close snack baggie. Don't keep your earbuds in your gym-shorts pocket or sports bra without a water-resistant case. Both of these places collect sweat and won't allow the earbuds to dry as frequently as they need to. Then when you arrive home, wipe the earbuds and allow them to dry as stated above.

Store your headphones and earbuds in a bag or case when not in use.

This will protect them from dirt, scratches, and impacts. Use the case you got when you bought them, or you can buy one later. Just be sure the case you choose will fit the headphones you have.

Don't use or store your headphones in very hot or cold environments.

Saunas and car trunks aren't good for headphones, especially if your pair has a battery. Also, don't store them long-term while wet or in a humid environment, even if they are water-resistant. Or, for extra protection, keep something like Westone Monitor Saver or a silica gel pack in the bag (just be sure to keep the gel packs away from kids and pets).

If your headphones are powered, don't leave the charge port or battery compartment open when storing them.

Even if your headphones won't get wet, leaving the port open can let in dirt and dust. If they don't have a door and they have just a Micro-USB port for charging, regularly dust out the port and check for water inside before plugging in.

Your headphone cable will last a lot longer if you wrap it properly rather than making a rat nest out of it. Video: Kyle Fitzgerald

Don't kink/bunch the cable or wrap it around your device while still plugged in.

Wrapping your headphones around your phone while they're still plugged in bends the cable where it meets the plug end at a sharp angle and can eventually pull it out of the housing. To wrap the cord properly, gently loop it around your fingers, making a circle with the cable, following the wire's natural curve. To prevent tangling, use a twist tie from bread or buy a little Velcro cable tie.

Videos: Caroline Enos

Always unplug your headphones by holding the plug or cable end, not the cable itself.

Don't unplug or remove headphones from your device by pulling the cable. It can weaken the cable over time. And definitely don't remove earbuds from your ears by pulling on the cable, especially if they're sealed. The vacuum created can cause damage to your ears. Instead, grasp the earbud and twist slightly while pulling outward.

Follow these guidelines and your headphones will stay cleaner and in better shape, and last you a lot longer. Happy listening!

This blog may have been updated by Wirecutter. To see the current content, please go here.

When readers choose to buy Wirecutter's independently chosen editorial picks, Wirecutter and Engadget may earn affiliate commissions.