It can be due to cervical spondylosis or due to frozen shoulder. You should consult a physiotherapist for proper assessment, diagnosis and treatment . If its frozen shoulder, it takes longer to get cured.
Next Steps
Go to a physiotherapist.. Ultrasonic therapy +IFT +Heating therapy +some strengthening as well as stretching exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long sitting /travelling /driving /computer work +no cold exposure +no manual exertions +no weight lifting +no jerks +no side lying on same shoulder +correct posture (sit tall) +use collar if the origin is cervical spondylosis.