What are the best exercises to strengthen upper and lower back/neck pain?

Extension. Neck&back pain can result from repeated flexed postures-examples of this are texting, writing eating.We are frequently in this forward bending position.This can result in disc herniations leading to pain.Repeated extension exercises can help reverse this and strengthen the back. I recommend the book "treat your own back" by r. Mckenzie. Yoga also improves strength and flexibility of the spine.
Its difficult. Its difficult to explain in words without actually showing you or looking at diagrams. Usually core exercises are the best to strengthen he neck and back muscles. These can be found online if you google core strengthening exercises.