Help - How do I stop talking to a friend?

E • Animal lover, artist, & wannabe chef. 18/CA 🦋💗🐺✨♏️
So, I have a friend. Let's call him "Zack".
"Zack" and I are really good friends. Ive known him for a long time and he is definitely one of my most valued friends. 
"Zack" is my boyfriend's best friend. 
"Zack" is dating MY best friend. 
"Zack" and I have history - I guess you could say we were each other's first loves. We never did anything, though, except hold hands. 
I know for a fact that "Zack" is still sexually attracted to me. I suspect that there is still some emotional connection, too, though he has not admitted it. (And I haven't asked - truth be told, I don't really want to know the answer). 
"Zack" and my best friend have lots of issues in their relationship - namely, that "Zack" does not value or respect her as he should. 
I think that I'm the reason why. I know I need to stop talking to him, but truthfully, I don't want to. He's one of my best friends and he knows me super well and we have a lot of fun together. But I'm not healthy for him, because I think he still has that obsessive fantasy and crush which came about years ago. 
So... how do I stop talking to him? I don't want to let my friend go. (But I understand that I should). 
Any advice is appreciated.. this is a really difficult decision for me.. tia xx