The pill with IBS

My doctor offered the pill to me because that time of the month is extremely difficult especially in school doing GCSE. Should I take the pill anyone on it does it work or any advice?