I'm going to tell my boyfriend that I don't want to have sex.
Why don't you want sex?
He wouldn't listen to me, he wouldn't stop messaging girls on social media.
It's understandable that you are feeling upset since your boyfriend has been messaging other women on social media. It signals that he doesn't care about you or your relationship. It's perfectly acceptable for you to turn down your boyfriend's request for intercourse since your relationship is on shaky ground and you should only have intercourse with people that you are comfortable being with.
I'm just going to tell him no and if he doesn't stop messaging other girls, I'm going to dump him.
That seems fair. I hope things work out.