Help me please

I had miscarriage 2 months ago but I don’t know the problem, have been having sex during my fertile days and on my ovulation days and any other days, but I received my periods