Toddler hitting himself *UPDATE*

A

My october baby hits his head with his hands, floor walls whenever he is upset, mad or was told no. Im starting to worry, I dont know what to do. I’ve tried ignoring, grabbing his hands and pulling him away from walls, talking to him. He keeps doing it. Do you have any advice?

I ignored him for 1 & 1/2 days and he doesnt do it anymore!!!