Image is everything. Talk with your child about how people look at a kid using foul language. Explain that when kids swear, it makes people think badly of them and gives them a poor reputation. The most important thing you can do as a parent is praise them for doing the right thing. If bad language has become a problem and little Johnny actually catches himself and corrects himself before saying a bad word, be sure to tell him how proud you are of him.
Positive reinforcement is the way to get more of the good behavior and less of the negative one.