Put a snug fitting rubber band on your wrist and pop yourself with it every time you do it.
If you really want to stop try replacing curse words with normal, harmless words like fudge or fire truck. If that doesn't work try pinch yourself every time you do it or try self motivate yourself to stop by simply saying this: "If I don't cuss for one whole week I will reward my self with a chocolate bar." It doesn't have to be a chocolate bar it could be a trip to the beach or go on a shopping spree etc.
Hope this helps :)
It's not a sin, especially if you only do it when you're angry and anyway it's only in your head! Stop beating yourself up over something that really isn't bad at all.
Meditate
Well for starters, how did those words get in your head to begin with? The best way to stop is by staying away from the bad influences. I find that hard too though. Many of the shows and YouTube videos I watch aren't very G. What I find to be helpful is to just filter it out with new information. I go to church camps where our iPhones aren't allowed, and all the worship songs and healthy conversations I have, cleans out my mind from all the bad language.
You can practice this at home to though. Try going a week or as long as you can without watching any shows with bad language in it. Substitute it with clean music and maybe some of your childhood shows, you'd like to go back and watch.
You could also try to control your temper better. Create new habits like counting or crying instead of becoming angry. Whatever works for you. Good luck!
As someone else said the rubber band method can be effective as well.