I think it totally depends on the cause of the back pain. Muscular, joint, disc damage, tendon... There are MANY different things that can go wrong, from arthritis to burst discs to nerve damage, so without a clear diagnosis even suggesting exercise may be a bad move, although they also now say that bed rest rarely helps.
I have two back issues, one is an unstable sacro-illeac joint. Causes all sorts of mayhem. Years of it has taught me that I have to sleep and sit in certain positions and not others, take great care when lifting, and that when it is not at a painful stage, walking is superbly helpful. So are core strengthening yoga exercises. I can correct the joint displacement myself, nowadays, sitting in an upright chair and twisting in a particular way. Not ideal, but it saves £45 a pop at the chiropractor. I put it back into position at least once a week.
I choose not to take painkillers for it, because past experience has taught that without the pain I over do things, and cause more harm than good.
My other back issue is actually neck pain, referred pain, all the way up my spine from the sacro-illeac joint which is where my pelvis and hips meet. As soon as I get neck pain, I crunch the joint back, and the neck pain improves.
Sorry to subject you to my Back Story, but I tell it to try and explain that backs are complicated, and need care and maintenance, and professional help, at least until you are familiar with the issues and reach a point where self-help is possible.