How can CBD oil help with pain and anxiety?

How can CBD oil help with pain and anxiety?