Break ups

How do you guys get over get over a breakup? I broke up with my boyfriend of 4 years. The relationship was toxic for both of us. I do still care about him but am tired of being hurt and hurting. How can I get over him? It’s hard I keep remembering all the hurt which helps but then I remember the good times and miss certain things a lot and then have thoughts like maybe if I do give him second chance this time will be different for us.