How to handle being treated disrespectfully by someone who I have to deal with b/c he is the father of my child

I can seem to get over the pain from my ex-husband/divorce. We got divorced last year and it is still affecting me and I feel like I keep feeling hurt and have a difficult time moving on.
We had a really nice love for the first few years but then he got really unhappy with his career and he ended taking it out on me. He refused to go to counseling or spend more than 2 days per month with me or our then 2 year old son. He was/is a work a folic.
He told me one day 2 years ago he wanted to end our marriage and the only answer I ever got from him was “its not working out” and he walked away. Then he left. I feel like I never got any explanation as to why he left. I feel like I didn’t even do anything wrong. Everyone I tell this story to doesn’t believe it.

Anyway now my son is turning 6 and he is having a bday party and both my ex and I want to be there. My ehxusband still does not speak to me after 2 year (he ignores me and literally doesn’t respond to me if I see him at a school event or he just walks away from me). So told him that I didn’t want us to be together at the birthday party for 3 hours with him ignoring me and treating me disrespectful. He basically said (in a text of course). “ I will not speak to you now or in the future. I believe I have made that clear”. I did a thought model on why this made me hurt and I did an intentional thought model on thinking “he’s a emotional child and I don’t want to speak to anyone who doesn’t want to speak to me” and that felt a little better but I gotta tell you it really is still hurtful to think someone has so much anger for me and I didn’t even deserve it? didn’t do anything but be a good wife and mother. I bend over backwards regarding our parenting schedule and he doesn’t appreciate any of it. How can he treat me like this? I feel like I need to shift my focus but not sure what other models or way of thinking to do. Thank you for any insight you have. This one has really been a barrier to my happiness overall.