How old is your son? It might be helpful in giving more age appropriate suggestions.
In general, you just need to be very consistent with your expectations as well as consequences. With a young child this may be as simple as redirecting the behavior each time. With a bit older child perhaps a time out would be more effective.
I found that my dd didn't always respond even when she understood - she is very independent & doesn't always agree with my rules! lol:)