You have to make a conscious decision to do other things, whenever the obsessive thoughts enter into your mind. And consciously deciding that you will not do certain things.
It’s not magic, the thoughts won’t just go away automatically on their own. You have to make a decided effort to do things differently than the way that you are doing them now.
Just for the sake of this thread, I’m going to assume that this fellow is not available to you for whatever reason, is that correct?
If you previously dated this fellow, but he’s not available to you now, and you have some physical mementos of your time together, whether it’s a piece of jewelry or some cards or notes or anything really, then get yourself a box and put all of those items in the box. You can decide whether you want to keep them or not. If you want to really get over this person, you can have a ritual burning of the box and then bury or scatter the ashes of the contents. If you can’t bring yourself to burn the box, then put all of the stuff in the box and then put the box away, up in the attic or some other place where it’s not easy to get to (but you still know it’s there) and then just leave it there. Sometimes just the thought of knowing that the box is there, even if you never look in it again, is quite comforting.
Now, on to the next steps. Unless this fellow is someone that you have to talk to, because he’s either a co-worker or a fellow student or he’s part of your other friend’s social circle and you might bump into him periodically, then remove all traces of him from your contact lists. Take his number off your phone, remove him from your facebook, erase his address from your real address book (and any other place where you have a listing or photos of him). Take any computer generated photos out of your devices and put any printed photos that you may have of him into your box.
Unless it’s an emergency, DO NOT drive by his house or the place that he works or any other place that you know he’s likely to be. If you have friends in common with this fellow, let them know that you are trying to get over him and for them to please not bring him up to you. With the exception of them telling you that he is planning to attend X,Y or Z events that you were planning to attend so that you can either choose not to go, or buck up before you go so that you won’t freak out if you see him.
Give youself a specific time limit (maybe a month) in which you will pick a particular time of each day (say 10 minutes, and actually set a timer) and then cry or scream or pine away for him, but only for those 10 minutes and then stop. After the month is up, stop it all. Just don’t allow yourself to do it. How do you avoid it? Do something else. Every single time!
You need to consciously decide that you are going to do something else, something constructive everytime you have the urge to think about or cry about this fellow. If you start to think about him, you need to have a list of 25 to 100 other things that you will immediately get up and do, instead of thinking about him. Even if that means that the thoughts are still there while you get up to do these other things. What we’re really trying to get you to do is to make a point of getting up and getting active and doing things that are helpful to you, despite the fact that he might be on your mind. The alternative is that you sit on the couch and mope about this guy and nothing else ever changes. The grief and agony will stay with you for a much longer time, if you allow yourself to simply sit there and pine away for this guy.
You have to change what you do in order to change the way you feel.
Avoid spending time alone. Being alone sets you up to want to indulge your boo-hooing over this guy. And don’t sit in your house doing nothing. Do something else!
Your best bet is to immediately get up and go walk around the block whenever you start to think about this guy. If you can, walk with a friend. Having a conversation with a friend (but not talking about this guy) is one of the most effective ways of getting over this type of thing.
Make a list of things that you want to do, whether it’s cooking or hiking or painting or sports. Whatever it is that is of interest to you. Then don’t just think about it, make plans, do research and find out where, when and with whom you will be able to do these things. Making lists and filling out calendars is very effective. And try to do some of these things where new, available males will be. Then if you spot one that you like, make the first move, go up to him and strike up a conversation. Don’t wait for them to come to you. You don’t have to look at all males as potential mates, just look at them all as potential new friends, and look at the females like that too. The more time you spend interacting with people that you like, the less time you will have to sit around worrying about what “might have been” with this other dude. What ifs are not useful. Start asking yourself what’s next?