Birth control - two periods in one month

I do not actively take BC. However, one day I decided to take a pill randomly. A few days later I started my period early. A week passed and now my period is back, this time during it’s regular time. Should I be worried or is it just because I randomly took a BC pill that caused my period to start early?