A pillow might not seem as important to a good night’s sleep as a mattress, but it actually has a very important purpose: to support your head and neck throughout the night, so that you can wake up without neck pain or stiffness. And after some time, even the nicest pillow will stop doing that.

The big question is: How long can you expect a new pillow to last? The answer is up for debate, but, to play it safe, get a new pillow every one to two years. Why so often? Night after night of sleeping on a pillow causes it to absorb body oil, dead skin cells, and hair. This isn’t just gross-sounding—it can also make the pillow smell and, what’s worse, can create the perfect environment for dust mites (common allergens).

To help prolong your pillow’s lifespan, wash it every six months and add a protectant case in between the pillow and pillowcase. Note that you can’t wash foam pillows—only ones with down or synthetic down filling (check your pillow’s label for laundry instructions before you toss it in your washing machine). Hot water and mild detergent will help get rid of any dust mites that are in there.

While washing your pillow may solve the allergen (and ick-factor) problem, it doesn’t help your pillow stay supportive. After nightly use, a pillow will lose its fluff and start to resemble a pancake. While some pillows might last a little longer (for example, down and natural feather pillows are more durable than those with polyester filling), they all will ultimately lose their shape. If yours is looking a little flat, fluff it every morning.

How can you tell if it’s time to replace yours? Check to see if any foam or batting in the pillow is lumpy and, if it’s a feather pillow, ask yourself if you constantly have to fluff it up to support your head or if it still does it on its own. Another test: Fold it in half and see if it stays that way. If it does, it’s time for a new one.