How to get rid of back pain from school backpack?

What age?? School back packs should not be hevier than 15 pounds otherwise the center of gravity of your body will switched form one place to the other and you will compensate by contracting the paraspinal muscles (muscles along the the spine) with consequent pain. Likewise there is pain if the pack is carried in one side and not evenly on the center of the back.
Adjust size. Make sure the backpack fits you properly by adjusting the straps or getting a better fitting backpack. Some backpacks simply don't conform to the body well. You may also need to carry less weight.