You are absolutely normal.
What is happening is that you are locked in a cycle of dependence.
When you are in a relationship and it breaks up, the natural feelings are of isolation and abandonment, and the fear that you will neveer have a happy relationship again. Suddenly the relationship you left starts to look very attractive, because subconciously, your mind will accept an unsuitable relationship if ithe alternative is no relationship.
That's why it is so easy to pine for your ex, and to slip back into a relationship with him again, so the whole cycle can go around again.
What you need to do is not to wear yourself out so you don;t think of thim, it's to reach a point where you think of him, but only in terms of the damage your relationship does to you, and that going back is not a good idea.
When you get to that stage, the cycle is broken, and you can start to build your life with a feeling of self-reliance, and not a life where you need this man to make you feel complete, and you are bereft without him.
If you learn to be on your own, when you do find another relationship, you will not be as dependent, which will make the relationship more balanced - you won;t be needy and insecure, and the next guy will not be tempted to mess you around because you will put up with it.
So take some 'me time' and know that you don;t need a man - especially this one - to fulfil you and make you happy. You are an individual, worth loving properly, and not because an unsuitable man is better than nothing.
When you have goe some self-belief and confidence in your ability to survive on your own, you will start to get over this man, and eventually to be ready for a new relationship.
Avoid the temptation to fall back into your old routine, it is destructive and it is holding you back - as you say. break this circle, and you will feel a lot better.
It's not easy, but it can - and it needs to be done.