Hard to say what actually helped, but two high-impact low-cost behavioral changes I made (and stuck with) were a strict ketogenic diet and regular heavy exercise (mixture of cardio and weight training). Ketogenic diet has a lot going for it - besides being a nice elimination diet (in case your problem is some kind of dietary autoimmune condition or food allergy or something), it also treats a lot of possible metabolic conditions. Exercise as well. I’m sure resting (mentally) helped but I didn’t have much choice there - resting was the only activity I could really do, and even that I couldn’t do very well.