Thank you for your question.
Pain during periods can be due to several reasons and the treatment changes accordingly. If the pain is worse at the beginning it can usually be managed with painkillers. If the pain is worse with bleeding or after the period it could be due to pelvic congestion or endometriosis both of which need proper evaluation by a gynaecologist specialising in endoscopy.
Your doctor is the best person to evaluate the pain and help you decide the best treatment.