how to get over an ex?

My ex and I dated for a short amount of time. Started end of 2014 and went to mid 2015, anyway it's been almost 2 years since we started dating and he's still always on my mind. Like I don't want him or want to date him but one look, one smile, one word and all the feelings come rushing back. I know he's a f@#k boy but the minute he talks to me I can't help myself but to talk to him and get so happy. Why is this? Who do I stop it? Like deep down he's always in my heart but I don't actually want to date him because I know he screws over girls and isn't loyal