Tips on breaking sinful habits?

I’m trying to stop swearing and saying rude/sarcastic things. I want to stop these things so bad but I am so used to them that they come out involuntarily. What can I do?