If you knew the answer to that, you'd be a very wealthy person. Chronic back pain is a problem to a large percent of the population and there are pain specialists that work just to manage problem pains in the human body. There are methods and medications that can help you cope with it but a "perfect way"? Don't think there is one.
Google the "Mckenzie Method" by Robin McKenzie and the book "7 steps to a pain free life" by the same author. A few simple steps are suggested for back and neck pain first aid. The suggestions in the book worked better for me than the round of 3 spinal steriod shots that my doctor suggested I get.