What do I do to fix this...

I messed up bad. We have known the same person for years now. I was friends with him before my fiancé was so we were good friends. Well one night he messaged me and we were messaging off and on and it started to get kind of weird. Nothing super bad just light flirting mostly from him because of him asking questions. Well I didn’t think it was that bad so of course I left the messages since I don’t hide anything from my fiancé. Well he read our messages tonight and took it to heart which I understand I would feel the same way if he was talking to some other chick. From the messages I wasn’t flirting but it looks really bad to him. I have tried to talk to him about it since he hasn’t had any reason before to not trust me we’ve been very open with communication and haven’t had any previous issues. So my question is how do I fix this... we have been together for 6 years and now recently engaged and he wants to call off the engagement because of this. I love this man with all of my heart but I’m crushed I made this mistake and now I don’t know how to fix it 😢 Please don’t judge me I know I am a terrible person for even messaging his friend I’m already beating myself up over this.