What do I do?

Dreame
There's this guy who goes to my college where we occasionally hang out with friends. Many months ago he would talk to me and flirt but I couldn't get with him because of school,but he would still continue to flirt and talk to me and even told me he liked me. Since last week he has a new girlfriend (which is one of my best friends) I wouldn't hurt her like that and decided to separate myself from him because if it was the other way around she would do the same for me. But recently I been more depressed and confused,but I'll would never hurt my friend because if I hurt any of my friends feelings I wouldn't deserve any of them as friends. But I'm struggling with finding ways to keep myself separated from this guy.
Ps My friend doesn't know I like him and wouldn't be with him if she knew I did.