Just so you know... it doesn't totally go away. LOL
When they become tweens that "attitude" can resurface with a vengeance. And anytime you let your guard down, it can come back, too.
What I do with my son (who is 12 now) is say: (dramatic pause with surprised expression on my face) "ummmm... You want to try that again, and remember who you are talking to this time?" Sometimes I just say
"uhh... try again". He gets the message and self-corrects.
But when he was little, I had to give more information to let him know what he was doing wrong. It's perfectly fine, and HELPFUL, for you to tell your son that "That is not the proper way to talk to me." And then teach him a better way to express himself. Kids don't automatically respect you because you're their mother. They LEARN to respect you because you TEACH them to. A concept that a lot of today's "feel good" society contradicts. It is perfectly okay to tell your child that they are doing something that they are not allowed to do and they must stop. It isn't a matter of getting them to WANT to treat you nicely/respectfully... it's just something that they MUST do. When they are made to behave respectfully, they learn that that thing/person is something/one to be respected. :)
At 4, you should explain to him that you are his mother, and he needs to talk to you in a respectful way. That means: no yelling, no screaming, no demanding, no arguing with you, etc. Bear in mind, Mom, that it takes TWO to be arguing, so if it gets that far, you have erred in how you dealt with the situation somewhere along the way (and we ALL DO THIS, so I am not putting anybody down here.. we ALL DO IT at some point. Kiddos are masters at drawing us adults into arguments with them). He can tell you what he WANTS but that in no way means that you HAVE to give him what he wants. Your decisions are the rule. He only has the authority that you LET him have/choose to share with him.
What I have done in other situations is tell my kids that "If you ___ (in your case: yell at me/get in my face) you will not get whatever it is you are asking." For us, it was "if you ask to have a friend come over to spend the night RIGHT IN FRONT OF THEM, then the answer will be "no"; you must ask in private". So you could explain to him that if he doesn't ask you for things in a respectful/polite way, then the answer will be "no". Give him examples of the wrong way (be silly and exaggerate! "MOM! Give me that COOKIE!! NOW! PLEASE!" explaining that just because he stuck a "please" on the end does NOT make it polite or respectful) and then give him an example of the correct way. ("Mom, Can I have a cookie, please?")
He will get it in time. But I would not just ignore it. Explain calmly what you don't like about the way he is expressing his feelings... and after a few times with you giving examples of a better way, ask him if he can ask in a better way.
Once he understands that the behavior is wrong, and what the correct behavior/way to ask is, then it will be easy to correct him when he forgets to use the correct method (see above: "ummm excuse me?" "uhh... try again." etc).