How do I stop thinking about him?

I have been hung up on this guy for years. We dated for two and have been off and on for about a year but I know he can be a jerk and isn't what I want in a boyfriend but we've got so much chemistry and he's so cute.... but I know I need to forget about him and move on to someone who will treat me right. How do I forget about him? I just want to be happy and single without any boys. Please help!