How do i stop liking this guy??

Jami

So there’s this guy i have been going to school with for a year. School is over in February and then who knows where we will end up in the world. We didn’t really start talking until around May (he was in a relationship) And then we didn’t talk for 2 months. And school started again and he was single now. Things started happening. We got really close as friends and then we kissed and thing progressed. We were an item at that point. Well it was a month into it and he found out his ex was pregnant. So we ended things and decided to be friends because we still had all the same classes together. But the sexual tension between us has been building. He opened up to me one night and said they’re not happy they fight all the time and that they are only together because she’s pregnant and he knows that it’s the right thing to do. I don’t want to lose him as a friend because he is my best friend. But i dont want something to happen because I have morals and i know it would be bad. But my feelings have grown for him. So how do we go back to being just friends??