Your pillow can make all the difference between a good night's rest and pain (both the morning after and possibly longer). To get the perfect pillow, consider your sleeping style—whether you sleep on your back, side, or stomach.

Lifestyle blog Lifescript says, in general, this is the ideal pillow:

The right support is medium firm and not too thick. It keeps your head and neck in a line, as if you were standing up.

For specific sleeping styles:

Back sleepers should look at memory foam, because it molds to the neck's curve, or a water pillow, which has consistent support. A pillow under your knees can help your lower back.

Side sleepers may also benefit from sleeping with a pillow between their knees: It helps improve spinal alignment. For your head, look for a medium-firm pillow that supports the space under your neck when lying down.

Sleep on your stomach? Unfortunately, your sleeping style isn't recommended at all, because of the stress on your lower back and potential for neck pain. Try sleeping with a giant body pillow in front of you to give you a similar feeling.

Check out the article for more detailed advice on which pillows to buy (you're supposed to replace your pillow every 4-5 years, apparently), including which pillow to look for if you have health issues like neck pain.