Since your partner has been an important part of your life in the past, it would be very difficult for you to imagine a life without them, at least for a while. At the same time, thinking about them, day in and day out, would not do you any good. So, it's time that you put an end to your "wishful" thinking and start looking ahead in life!
First things first, get rid of your ex's photographs, gifts they gave you, or any other thing that reminds you of them. Dump all such things in a bag and put it in a place in your house which you don't visit often! Remove all physical signs of your ex's existence as looking at them can bring back their memories.
A drawback of being in a serious relationship is that you do not get enough time to socialize. Most of your time is spent in being with your partner, so much so that sometimes it becomes months since you meet up with your friends.
If this is true in your case too, now that you are no longer in a relationship, you can utilize the time on your hands by catching up with old friends. So, go out with your friends, meet up with new people and make some new friends too. This will certainly keep your spirits high and help you forget your past.
Instead of obsessing over someone who is not with you, why not devote the same time in knowing yourself. Maybe the reason why you are still thinking about your ex and are unhappy is that you are not satisfied with a certain part of your life. So, for a change, start thinking about yourself, your life, and try to put the missing links together!
Here's hoping that these tips help you handle this situation. Besides these, one very important advice for you is to practice mind control. If you can not stop thinking about someone who does not want you, it shows that you lack control over your thoughts.
So, be strong, learn to choose the "thoughts" that you want to think, be patient with yourself and with time, everything will fall in place!