how to stop yourself from sending an “i miss you” text

me and my ex haven’t talked in three months. we ended on good terms and stuff but I was unable to keep a friendship because it was too much for me. sometimes I find myself tempted to text him. I had to delete him on social media because I couldn’t see him living his life without me. it gets so intense that sometimes I dream at night of sending him one :/. how do I stop myself? we are on the same college campus and I always run into him and it makes things worse.