Source: Verywell Health
Neck pain from sleeping wrong is often caused by muscle strain. This may be the result of sleeping on the stomach, using a pillow that's too high, an injury, or sleep issues. If you wake up with neck pain, treatments include cold or heat therapy, stretching, massage, and over-the-counter pain relievers. Sleeping in a neutral position can help prevent neck pain in the future.