How to deal with “no contact” in break up, any tips?

How can I not mess up and go back to him, I blocked him on everything but there’s always this little thought in the back of my mind “what’s he doing, I miss him”

I left him and I know it’s a very unhealthy relationship.

Is there any tips to keep it out of my mind and stop the temptation from being lonely?