I need advice ASAP

So like a while back my friend was dating one of my exes (I was pretty cool with it but I secretly still liked him) and once a yr there is this thing we do at school where our names get pulled out of a hat and those 2 ppl get to leave school early and of course I got my ex so we were at the tram stop and we started talking then he asked where I was going and I said home and he said come to kfc with me and I said yes but we can’t tell his gf/my bsf and we had so much fun and after we finished he hugged me and I regretted going with him and I didn’t know how to tell my friend and it’s been like 3 months and they broke up and I still haven’t told her because she is my bsf and i really don’t wanna lose her

Any tips?