Purchasing a new mattress can be a nerve-racking ordeal, but once you pick the perfect one, you’ll have years of great sleep.

Here are the some guideposts to help you mattress-shop. It’s all about the who, what, where, when, why and how.

Who

You, if you wake up stiff or achy. If you find that you always sleep better and feel more refreshed after a night in a hotel, that’s another sign.

When

Experts say mattresses wear out about every 10 years. Of course, that can vary based on the quality of your mattress. It can also vary based on your body. Some experts suggest that people over age 40 replace their mattresses every five to seven years, because they need better support and are more susceptible to pressure on our joints.

Where

In-person stores:

Consumer Reports suggests that you lie on each mattress for at least 15 minutes because its testers found that the same mattress they liked after 15 minutes was the one that they liked after a month.

Online stores:

If you’re set on getting a memory foam mattress, we’ve listed a few popular online companies, with prices listed according to a queen size. Many of these sites feature just one mattress, give you a 100-day trial period and have generous return policies.

For reviews and comparisons of memory foam mattresses to buy online, check out Sleep Like the Dead and The Sweethome.

Why

You’re probably going to spend a third of the next decade on this mattress. Even though this all may seem-time-consuming, it’s worth the effort.

What

There are four main types of mattress, and which you choose is purely preference: innerspring, memory foam, latex or adjustable air. That said, some types tend to work well for people with certain body types or sleep styles. Here are the Good Housekeeping Institute’s recommendations for who might like what.

1. Innerspring

Best for those who like an affordable, bouncy-feeling mattress.

  • Classic mattress, with metal coils inside and ticking near the surface.
  • Very affordable.
  • The metal coils are usually available from 12 to 18 gauge. The higher the number, the thinner and bouncier the spring. (Heavier people have been known to prefer a lower number/thicker gauge.)
  • To cut down on movement by a bed partner, choose an innerspring with pocketed, individual coils. They are covered in fabric to reduce movement from one side of the bed to the other. Many innerspring mattresses have “pillow tops,” but experts caution that if this layer is thicker than an inch, it will soon sag and develop annoying body indentations.

2. Memory foam

Best for side sleepers and other people who want to reduce pressure, particularly on the shoulders and hips.

  • Memory foam mattresses are known for reducing pressure on your body. They provide a very still feel.
  • Sleepers tend to sink into the foam a bit and be cradled in one position. That cradling and the type of foam can cause some people to heat up as they sleep.
  • The memory foam layer usually varies from two to six inches thick and that the deeper it is, the more you’ll sink.
  • If you are concerned about the fact that this type of mattress is made from a chemical process, then look for one with materials that have passed CertiPUR-US or Oeko-Tex testing, which means it does not off-gas excessive chemicals.

3. Latex

Best for people seeking natural materials and strong support.

  • Latex mattresses are unique in that they can feel very soft and yet also springy and uplifting.
  • There are two manufacturing methods: Dunlop, which is denser and firmer, and Talalay, which is softer and springier.
  • Sometimes the two are layered together. You should know that some manufacturers blend or layer latex on top of man-made foam but still label the mattress as “latex.” All-natural latex mattresses are more expensive than some other types.
  • Latex mattresses are common in Europe and growing in popularity in the United States, especially online and in high-end sleep shops.

4. Adjustable air

Best for couples with very different tastes in mattresses.

  • The air pressure is adjustable, so you can choose a firmer or softer feel at any time and maintain a different mattress firmness from your sleeping partner.
  • Certain air beds have performed very well in Consumer Reports mattress testing, but be aware that consumers have had problems with mold, noise and mechanical failure with some makes and models.

How

When you shop for a mattress, you should haggle. Yes, it’s similar to shopping for a car in more ways than one. In fact, many of these car-negotiating tips from an earlier column apply. Negotiating at chain mattress stores is routine, and there you should be able to get 20 to 50 percent off. But even at high-end stores and online stores, you can often cut a deal by requesting a recent sale price or asking them to throw in extras. At the very least, go for free delivery and pickup of your old mattress.

Finally, write a “no substitutions” clause into your contract so that after doing all this work, you can rest easy knowing you got the mattress you actually wanted.

I know I don’t want to stay in the city I live in forever. But I don’t know where to go.

I feel saddled with a sense of impermanence

15 books that are new (or newly relevant) for the summertime

The Lily’s Book List includes 10 new releases, plus five older picks

A look at the good, bad and unfair of this year’s high school prom season

Here’s a look at a few examples