Yelling can make children hyper. It gets them all excited. Spanking after a while just does not have that "shock" factor anymore. It does not mean anything.
As a 4 year old his behavior still falls in the "normal range".. Children this age need a LOT of exersice.. Make sure he gets to run around for at least an hour in the morning and an hour in the afternoon.. Swinging, running, peddling, jumping, climbing.. They just have to release all of that..
You have to learn to deal and speak with a 4 year old. You cannot just make a child stop on a dime and have them do something else. They need a few moments to finish their activity and then transition to another project.. It is like me walking into your kitchen while you are cooking and saying. Ok come on right now, I need you to go outside and mow the lawn.. You are not going to be able to just stop.. Playing for a child is their work..
Learn to say to him. "Listen to my words." Make sure he is looking at you. If you are not sure he understood, ask him. "Did you hear what I said?" Or have him repeat what you just said.
" I am going to give you 2 more minutes to play and then you need to put all of the toys back on the shelf." Then leave and see if he can do it.. Then after 2 minutes, let him know. "Thank you for putting away your toys" (get a timer if you need to)
"Please get your jacket and pick out a snack for the store. We do not buy snacks there." "We will be leaving for the store in 5 minutes."
Then once he is ready tell him. "Thank you for being ready on time."
While in the car go over the rules of behavior in the store. And have him help you remember what is on your list. "Remember, inside voices while we are in the store." "we do not run in the store." "Here is what I need your help with. Please help me remember to buy.. milk, dog food, sticky notes.." This way he has a job to do while there.. Congratulate him when he helps or remembers. Ask him? "What side of the store should we start on? Left or right?"
When he acts "hyper" ask him to sit down a moment and calm himself down. ask him if he wants a hug. Sometimes speaking in a stern slow quiet voice can be just as powerful as a yell, a scream or a swat.
I am sending you strength.