I have gone through the same thing with my son. I found that a reward chart helped. The tasks to accomplish were things like no whining, no bad words, helping mum, tidying up, going to bed, just really basic things to begin with. At the end of the week, see how many positive things have been achieved, then reward him. I found with my chart that if a tasked had been acomplished, then my son misbehaved, the task was crossed out and had to be achieved again. This made my son stop and think about what he had done. It took my son about 3 weeks to overcome his problem, but even though he is now behaving, we are carrying on the reward chart. As noxlumos said, ignore bad behaviour, as if he is getting attention for doing bad things, then he will carry on doing so. Reward good behaviour, and ignore the bad. I know it sounds cruel, but believe me, it works!!!
Good luck!!!