I miss my ex, I broke up with him because he ignored me and got embarrassed by me and then only 4 days later my so called best friend started going out with him. I hurt so much what can I do to make this pain stop?

Hmmm embarrassed how?

You should talk to him, apologize for your previous behaviour and make a promise not to act in that way again, you need to also express your feelings but be wary, if he is going out with your friend then jealousy could arise

Maybe try to analyze the situation carefully and find out who is right and who is wrong.