You need to find out if you have pain at rest or when you move your neck. In case you get pain while moving the neck, then find out in which position who have maximum pain and which position relieves your pain.
1. If you have pain at rest - could be infection, inflammation or trauma.
2. If you have pain when you move - find out which movement aggravates the pain. More chances of trauma or degeneration in this case.
Also please check if you feel any pain along the shoulder and your arms.
Next Steps
Get a neck X-ray done and go to a consultant orthopaedic nearby.
Health Tips
Using cervical collar might help you in keeping your neck in stable position. Consider using that temporarily if you don't have pain at rest.