When you are sitting, make sure your feet are flat on the floor. If they don't reach the floor, use a collapsible foot rest that you can carry with you. Pain in the mid-back area is often due to stress. Concentrate on sending your breath into that area to help relieve the stress. Pain in the lower-back region can come from being overweight, from an injury or strain, or lack of exercise.
Some people find that ice relieves their pain, some like heat.
Follow your doctor's advice on this, but when in doubt, start with ice on and off for 24 hours. Suggested products to ease lower back pain. Over time I've found many products that will relieve pain. My website is full of them because that's a big part of what we do. A Knee Wedge for proper pelvic tilt.