It can be due to sue to some cervical problem like discitis/or disc slip/some sometimes due to simple wrong postural habits like long sitting/travelling /computer work/prolonged neck bending. Sometimes it can be associated with any tingling/heaviness /numbness ain arms and hands.
But if its associated with the lack of range of motion of shoulder, it can be frozen shoulder.
Next Steps
Go to a physiotherapist for proper assessment, diagnosis and treatment. Ultrasonic therapy +IFT +Heating therapy +traction(may require) some strengthening +stretching exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long sitting /forward neck bending /avoid travelling /driving +no cold exposure +no manual exertions +no weight lifting. Use cervical collar.