Pain in the back and neck my be related to the muscles of that region. So it is usually caused by job and travel etc..
May be you requie a course of muscle relaxants..get a consult from a neurosurgeon and follow his advice
Back and neck pain are very broad terms!! In general too keep ones spine healthy minimum half an hour walk on a proper walking track at a normal pace ( no brisk/slow walking ) is very important!! During walking do not talk on phone with neck bent on one side!! You can use earphones!!
Apart from that long sitting has to be completely avoided!! By long sitting I mean for a healthy spine one can only sit 60-90min at a stretch!! Sitting longer than that will create lot of issues in the body!! If you are sitting for a long time, then set timers and just walk around your desk, or go have water!! Few steps are also enough but one needs to stand!!
So in a jist 1) walking for half an hour 2) avoiding long sitting 3) rolling your shoulders and doing nano workouts will help your spine to stay healthy!!
To get a detailed examination and exercise protocol you need to reach a physio near you and take care of your spine!
Back and neck pain could be because of many reasons.. It may be at vertebrae level, disc level or muscular level.... The underlying cause of pain is important to know before we suggest exercise... Moreover if the pain is severe then it's suggested to take rest... Reduce the pain and then do exercises... You need to have further clinical evaluation.... Find a good orthopaedic consultant or a physio near your area through the app