Sexual tension with best friends boyfriend

My best friend is dating my X boyfriend and I hang out with them all the time. I dated my X for two months and it was pretty casual but we did like each other and hook up a lot. We kinda fizzled out and I started dating his best friend so I thought it was only fair if he dated mine so I didn't really care when they got together. Everytime I'm with my best friend and my X I feel such strong sexual tension with him. Like we've seen each other naked and he's done things to me and I have to him too. I would NEVER hook up with him because I love my best friend but how do I get over this? I'm no longer dating his best friend but we are still hooking up so its all pretty complicated. How do I get over this sexual tension? My friend tells me about their sex life and it's just like even harder for me