For chronic neck, mid-back and lower-back pain related to prolonged sitting and poor posture, passive modalities such as heat, TENS or ultrasound may help temporarily reduce pain and muscle spasm, but they should generally not be the mainstay of long-term rehabilitation.
A progressive, individualized exercise program is usually more important for long-term improvement. Treatment should focus on mobility, postural control, strengthening of the deep neck, scapular and core muscles, flexibility, and gradually improving tolerance to sitting and daily activities.
Passive modalities can certainly be used when clinically indicated, particularly during painful phases, but ideally as an adjunct to active rehabilitation rather than a replacement for it.
Next Steps
I would recommend a proper physiotherapy assessment to identify which movements and postures reproduce your symptoms and to assess spinal mobility, muscle strength, flexibility and neurological status. Based on this, your physiotherapist can develop a graded exercise program and progress it according to your response rather than relying mainly on modalities.
Health Tips
Avoid trying to maintain one "perfect posture" throughout the day. Regular movement and changing positions are often more useful than rigidly holding a particular posture. Take frequent movement breaks during prolonged sitting and gradually build your activity and exercise tolerance.
If you develop radiating pain, persistent numbness/tingling, weakness, problems with balance, bowel/bladder changes, unexplained fever/weight loss, or rapidly worsening pain, seek medical assessment promptly.