This happened to me when I was in an abusive relationship and then going through a divorce during the preclinical years. I still matched at my top choice gen surg program. As others have said. Do well on Step 1, perform well in clinicals and have a clear succinct reason for it and what you did to correct the academic issues for the ERAS section that covers it. When your school does the MSPE they'll include info about it and I found it helpful that they were aware of my relationship issues and put some brief information about that and how my performance changed afterwards in the MSPE. I didn't suger coat it on interviews and had some phrasing worked out ahead of time to the effect of "I made a bad choice that had a ripple effect on my life but was fortunate to have the support of those in the academic world and professional support that allowed me to overcome it and rebound and I learned a lot about myself and grew as a person... yada yada." Most of the comments I received at interviews (if any because it was so well delineated on my application) were along the lines of encouraging about how I showed perseverance through adversity.
It's all about the upward trend. Granted I didn't try to match derm or anything, but it worked out fine for me.