Everything you do and learn during medical school contributes to the total package you submit when applying for residency. However, it's not just the events that take place (e.g., a research project, a leave of absence), but how you handle them. No one expects you to be perfect — but residency programs do expect to see that you try hard, learn from your mistakes, are open to feedback, and strive to improve.
Maximize your experiences during medical school, learning and growing as much as possible. Use these strategies to strive for positive outcomes including personal and professional development as well as to successfully recover from and move past less than ideal situations.