How do you stop being in love with someone who doesn’t love you back?

My friend, who I had a crush on for 6 months, started flirting with me. I was okay with being just friends but when started showing interest I obviously fell for him hard. Then when I asked him if he actually has feelings for me he said that he is “scared of a relationship” and shouldn’t have led me on. Why did he initiate it in the first place then? What can I do to fall out of love with him now? What’s worse is I still wanna keep talking to him because I not only lost a crush, but also a friend.