When it comes to sleeping, there is actually quite a lot to consider to maintain a neutral posture for the best sleep quality and to prevent stiffness, neck pain, or upper back pain when you wake up. The pillow, therefore, is something that must be considered to promote proper spinal alignment while you sleep for 8 hours a night every night!
A good pillow is one that allows the head and neck to remain in a neutral position. But what is neutral for the neck? The neck actually has a slight curve to it naturally, it looks like a backward shaped C when looking at an x-ray of a neck. So in order to maintain that curve while we sleep the pillow needs to conform to the neck. Most people make the mistake of supporting the head with the pillow when they should be supporting the neck. So a proper pillow must be under the neck to support the curve! A simple picture of this is posted below.
Notice how the head is in the middle of the pillow and the edge is underneath the neck resting on top of the shoulders in both positions. This is giving support to the neck and you can see the actual backward shaped C curve as well. This is the best position for the pillow that will help to prevent waking up with neck pain, a stiff neck, or even a headache!
The next aspect to consider when choosing a pillow is how soft or firm it is. You want a firm pillow, one that has a little give so that the head will sink in to, but not too much give to where your head sinks all the way down to the bed! Firmness gives that little resistance that will again support the shape of the neck while you sleep. I can't express how crucial this is when it comes to a good pillow, most people think a soft fluffy pillow is going to be the most comfortable, however it does not support the neck. Your head and neck are in one or two positions for 8 hours straight every single night while you sleep, wouldn't it be important to make sure we are protecting our spines during that time?