The first thing you should do to take care of your back is to actually pay attention to the signals it gives. A little pain can be understandable and maybe even be ignored, depending on what you were doing at the time. However, if your back is becoming a source of chronic pain, you may want to consult a physician. Chronic pain can be a sign that something is wrong with your back. The list of possible causes for this type of problem is fairly long, but it can include things like torn muscle tissue or decreased bone density. Even if the pain isn't chronic, if it occurs frequently enough, then you might still want to consult a medical professional. Things like this are often signs of worse problems and are best attended to while the problem is still in the early stages.
Be sure to warm up and cool down your muscles before engaging in any sort of heavy physical activity. This includes stuff like lifting objects and do-it-yourself tasks. Getting your muscles prepped up for physical activity is key to keeping them from being damaged and causing you a lifetime of chronic pain complaints. Properly lifting weights can also be used to help reduce the amount of stress and damage that you do to your back muscles. Avoid twisting your back when you lift an object, and make sure it is as close to your body as possible. Also, use your legs to provide to provide the strength needed to lift the object off the ground to avoid damaging your back.
Proper support of the neck and back is critical to preventing back injuries. In general, sleeping on your side is the best for the back, as it relieves a large amount of pressure on it. Sleeping face-down can cause a lot of damage to your neck and back, depending on how you sleep. Use a pillow that provides adequate neck support and make sure your head isn't elevated too much from the rest of the body.
Along the lines of the above idea, you might also want to take a look at the right furniture to support your back. In general, the “comfortable” chairs are terrible, as the back is not properly supported and can often make you slouch to do your work. Preferably, the chairs should be kept straight and your feet should touch the ground. A nice, firm bed that isn't too hard is also good for the back.