2 periods

I’m 19 and I’ve always had problems with my period being irregular recently it didn’t come for 8 months but I wasn’t pregnant I’m not trying to have a baby right now but in the future and I’m worried I won’t be able to I went to a planned parenthood and they gave me birth control to get my period back on track it worked but now I’m getting 2 periods 15 or 16 days apart and my period tracker said I might have something called anovulation ? I googled it and it said it may cause me to be infertile,

Does anyone know why this is happening and if that will stop me from having a family In the future ? Thanks