M.H.
Something that has always worked well in our home is giving them a model of how they should be communicating. For instance, my son will make a demand of me while I am tied up doing something for my toddler. I then respond, "I am sure that what you meant to say was, "Mom, when you are finished getting that bottle for baby, can I have a drink?". I then ask him to repeat it back to me in an appropriate manner, literally copying the words and TONE that I have just givin him as an example. This gives me an opportunity to acknowledge that he is feeling frustrated that he has to wait his turn and to coach him with a better way to communicate with me. Unless he refuses to repeat his requests back in an appropriate manner...I don't spend much time hashing out what was wrong with the initial request. If he refuses to mimic back his request in the correct manner (which rarely happens), I then explain to him that it is unacceptable to talk to me that way (be specific about how they are talking) and that he needs to sit in time out and think about how to talk to me. At the end of time out, I reiterate the way he should have asked...ask him to apologize and ask me correctly. It has worked so well, that now if my son is back talking or being snotty, I can typically look at him, raise my eyebrow...and he back tracks. My son is now 5 and we started it when he was 3.
Good luck!