Why can't I get pregnant?

Has anyone who has struggled with getting pregnant tried anything different and then ended up conceiving? If so tell me what you did! My boyfriend and I have been ttc for 2 years now and after 2 miscarriages I feel like I will never get my BFP. I feel like I've tried everything, I've even talked to my doctor and they don't know why I'm having miscarriages 😭