I sometimes don't have regular periods what should I do?

Depends on Needs. Irregular cycles usually means irregular ovulation (egg release). I agree that tests needed to make diagnosis for correct treatment (meds). If you want pregnancy or contraception then med choice different. Years of irregular cycles are health hazard too. Tests and treatment not too complicated, expensive, or dangerous. See your gyn provider for help.
Burt control pill. Depending on age and other factors, your doctor has plenty of tools to look into what the cause may be, as well as treatments.