Mostly just time
For most muscular symptom presentations in the neck, it takes a little time to clear. Sometimes, this may be an initial symptom of another problem like a disc herniation but those usually resolve with time.
If you smoke, stop. Local heat application may help as can simple stretching of the neck while showering and avoiding prolonged positioning. Otc medication
may help if no contraindications.