It is most commonly used to treat chronic pain, anxiety, inflammation, and insomnia. One study showed that CBD may relieve pain by affecting receptors of the endocannabinoid system, which helps regulate pain, mood, and memory, in addition to many other physiological and cognitive functions.