Functional Q&A-Transforming pain

Conditions like endometriosis and fibromyalgia that are recurring and very painful are hard not only on the body, but on one’s mental health. One starts to feel dejected and depressed when hit by such severe intensity of pain month on month. What can be done to build mental immunity on dealing with life-long conditions? If