Irregular periods

Tasyah

I was on nexplanon from 03/2019 to 08/2019. When it was removed, I got my first period in 10/2019. Ever since then my periods have been very irregular. My cycle length use to be 31 days but now it’s 40 based on this app. How can I return my cycle back to the way it was ? Is there any medicine? How can I better track my ovulation? We’ve been ttc since 12/2019 with no luck.