An acute episode
If you hurt your back lifting, or you develop acute pain after sneezing or suffer another form of trauma, then it is likely that you have injured the tissues and thus will have some degree of inflammation. (This is like spraining your ankle) Therefore, for the first 24 to 48 hours you should not put straight heat on the area. If you put heat on an inflamed area, you will increase the inflammation and hence the pain. Icing or contrast bathing (alternating heat and cold) is best.
If the pain is severe, you may need to rest for a day or two. However it is best to try to modify your activities and stay active. Resting in a position of ease is good. Try to lie in a position which eases the pain the most. You can try lying on your back on the floor with your legs up and knees resting on a chair, sofa or low table. This helps to take the strain off the low back. Make sure you have a small pillow under your head.
Try to move within your pain-free range of motion as much as possible. Not moving at all for fear of pain will make the problem worse. Gentle stretching is also helpful as long as it does not aggravate the pain.
If you wish to take painkillers, it is always best to check with your doctor or pharmacist first.
It can be a good idea to see an osteopath for a diagnosis and treatment. Although the pain may slowly resolve, it can leave restrictions or weaknesses that may predispose to future problems. It is common to see patients who have had mild to moderate back problems which have mostly resolved themselves, until it has lead to a more major injury, such as disc protrusion, which then takes a lot longer to improve.
Developing a good back routine is best for managing a chronic back problem. An osteopath will be able to assess your body and address any restrictions found. They will be able to advise you on improving your posture as well as a good stretching and strengthening routine.
REMEMBER THAT PREVENTION IS BETTER THAN A CURE. GOOD BACK HABITS DEVELOPED NOW WILL HELP PREVENT FUTURE BACK PROBLEMS.