Thanks to high-performance fabrics and strong odors that linger long after washing, activewear can be tricky to clean.

When you're working hard, your performance tees, sports bras and yoga pants are collecting sweat, body oils and dead skin cells. This mixture ends up growing a nasty bacteria farm that smells less than fresh, even after your clothes have been through the wash cycle.

On top of that, a lot of workout clothing is made with polyester, nylon and other materials that can wear down quickly if not washed correctly.

To really knock out the smell from sweaty clothes and to make your activewear last longer, you need to wash them a certain way. Here's how.

Get the right detergent

Before you can give your activewear a good wash, you need to choose a good detergent. There are many specialty detergents on the market that are specifically designed to remove stains and smells that get trapped in your workout clothes, like Defunkify Active Wear Laundry Detergent Powder and Sweat X Sport Extreme Laundry Detergent.

You really don't need a special detergent, though. There are some brands that work great for activewear and your regular laundry, too.

For instance, Consumer Reports lists the top three detergents for activewear as Persil ProClean Power-Liquid 2-in-1, Tide Plus Ultra Stain Release and Tide HE Plus Bleach Alternative. All three of these choices can be used for everyday loads.

Now playing: Watch this: Tech essentials for fitness buffs

Wash it right

Now that you have the right detergent, let's get down to the washing. First, like every other load, separate your whites from your darks and pretreat any stains with your normal stain remover stick or spray. Then turn everything inside out before you throw them in the washing machine.

Next, measure your detergent using the guidelines on the bottle. Do not add extra. Extra detergent won't rinse away properly, leading to a buildup of grime on your activewear that can trap sweat, oils and skin cells more easily, making the fabric even stinkier after normal use. Skip the fabric softener, too -- it can also leave a residue that will trap gunk.

Finally, for high-performance fabrics, set your load to a delicate cycle with cold water. Hot water can damage the fibers of your activewear, plus most detergents -- like the ones above -- are designed to work better in cold water anyway. For gym clothes that specify you should hand wash only, you can probably get away with including them with those loads.

Cotton workout clothes can handle the normal cycle of your washing machine, and stick with cold water.

Dry carefully

Skip the dryer when your clothes come out of the washer. The heat can ruin the fibers, making your workout clothes less stretchy and even misshapen.

It's best to let items air dry, but hanging them up to dry isn't a good idea, either. Hanging them can make the fibers stretch out.

Your best bet is putting your activewear on sweater racks. This will allow the items to lay flat while they dry so they retain their shape.

Still smelly?

If your activewear is still funky after these steps, try soaking the clothes in 1 cup of white vinegar for around 30 minutes before putting them in the washing machine. This will kill any lingering bacteria.

How to clean smelly sneakers

Have your running shoes seen better days? There are a few easy ways to revive them.

First, try sprinkling baking soda inside smelly workout shoes, which helps absorb strong odors. You can also stuff dryer sheets in the shoes to absorb odors. If they need more help than that, checking out our guide to cleaning your shoes in the washing machine.

The information contained in this article is for educational and informational purposes only and is not intended as health or medical advice. Always consult a physician or other qualified health provider regarding any questions you may have about a medical condition or health objectives.