How to redirect thoughts

So my ex bf broke up with me because he “needed space and to figure out what he really wanted,” prior to that he told me he felt like he failed at making a family and started being distant. I wasn’t sure what he meant by that but he has a child by another woman and obviously they’re not together. Anyway this was his second time breaking up with me. He said some hurtful things which probably aren’t a big deal to him since he lacks empathy, but either way it still stings because we were friends first and I feel like I lost two relationships. I cordially departed with him and blocked him on everything. It’s been a week, but I still have thoughts of him and want to reach out (it crosses my mind, but I control myself by thinking of how I was treated). How can I redirect these thoughts and get over him quicker?