best friend and sex

so I have this best friend of two years. there has been mutual feelings for each other BUT he has a girlfriend (1.5 years) now they've been having lots of issues as he has talked to me about it. he's helped me with a bunch of things and I've helped him. now one night I crashed with him as I was afraid of going home, things get heated and we end up hooking up. we both agree it won't happen again but I stayed there again and it happens again. I don't know what to do now. we still talk and act like nothing happened but feelings were there before hand 🤦‍♀️ I still look at him as just my best friend (who I like...). we haven't talked about his girlfriend since this happened, so I don't know much about it anymore. I'm just confused at this point. I don't know who to talk to as he's my go to person and he doesn't want to talk about it..