Period pains vs mental health

I took a break from the pill due to health reasons. Then my period pains get extremely bad so I went back on it, and I can feel my mental health deteriorating again. Is there anything you can suggest or which you think is the better option.