I agree with Agiel. You must talk to him, explain you him why this relationship did not work out. No spell will help change his feelings as he, himself, is entitled to free will. There is a difference between love and obsession. Only time can heal all wounds. He may not be dealing with the heartbreak that well now, but he will eventually heal in time.
First off, for safety reasons, make sure you are cautious. If he is in love with you still and is still is heart broken thats one thing, but an obsession is another. Make sure you take the matter seriously if its a full obsession. Talk to the police if you don't feel safe or if he starts stepping boundries such as stalking you. Also be cautious online. Its not uncommon for exs to catfish.
Ok now that that's done, I'm sure you mean he's still heart broken and not that he's dangerouslyobsessed. That was more or less a "just in case" warning. Now, as for his heart break, everyone here commenting are right. Love is an odd thing sometimes, but as long as its just love there isn't much you can (andmore or less, should) do.
You can communicate with him and figure stuff out. Maybe he just thinks you're friends. Maybe he has moved on and he treats you the same. Maybe not, maybe he just thinks that if he keeps holding on he can fix things. Whatever the situation is, you only know for certain by asking.
If things still are an issue, you can tell him again. Further steps you can do are distance yourself, hang out with your own friends more, pick up a new hobby, meet new people, and showing him you've moved on by getting back into dating (if you're more than just moved on. Only get back into dating because you want to and are ready. No one wants to be the fall back date.)
Take a black candle and on it carve the words "Good bye". Rub the candle with lemon or citrus scented oil (lemon, lemongrass, citronella, etc) from the wick to the base. On a small piece of paper write your ex boyfriend's full name.
Light the candle and when it has burned down about halfway take the name paper and in your own words wish your ex a long and happy life away from you. Light the paper and allow it to burn to ashes (a fireproof bowl is handy to drop it into). Pinch out the candle and bury the rest of it, along with the ashes, at a graveyard or a crossroads.
Go home and have a bath or shower, using some cleansing herbs such as eucalyptus or hyssop, and get on with you life.