Any advice on how to not take your ex back as a friend or partner?

My ex and i broke up because the fire just went away for us and we had no more connection. Plus during our relationship he broke my heart so many times and was just never there for me to support me.

We agreed to be friends but thinking about how he treated me in the relationship gives me reasons and no motivation to keep talking to him.

So then he started acting like a total douchebag for some reason, then we had a fight and said mean things.

Any advice on not to look back and feel bad? I've been having urges to fix things with him but i stop myself. But any wisdom to help me not look back? Please and thank you.