How to get over him

I know I like him enough to date but he just uses me to hook up. Took me 2+ years to realize this because I like him so much :(

How do I get over him? What are good methods to get out of this funk and recognize the reality of the situation???