Any behavior can be understood as a tool to get needs met. Whining, tantrums – also affection, humor. Any particular behavior may not be a good strategy, and for little ones, it's often a bad strategy. Children melt down – not as a deliberate, planned manipulation (at least, not those first tantrums), but as an intuitive way to try to meet their own NEEDS, one of which, by that point, is to let out overwhelming frustration.
If a child senses that a behavior has hooked you emotionally, he feels at least a little more powerful. Because he is feeling very little power, it's very, very attractive. He'll gratefully take any power and control in whatever form he can find it.
Disarming all that frustration BEFORE it culminates in a meltdown is useful. Consider life from a child's angle. Notice all the frustrating, controlling, maddening and discouraging situations for a new little person with little choice and limited motor skills and language. Find creative ways to reduce as many of those frustrations as possible. This in turn should reduce the child's negative strategies to deal with his own frustration.
The child's feelings are not "wrong." He really doesn't choose them, any more than you "choose" to feel upset when you're baffled by yet another tantrum. Anger and frustration are natural, and completely legitimate. Discouraging them through punishment doesn't make them go away, but might drive them underground until they emerge in some other form.
Certain techniques reduce a child's frustration level, so tantrums will gradually happen less often. Things that have really helped my 4yo grandson are:
… 1. Making the tasks we need from him become a game, or pleasant. For example, he doesn't want to take a bath. I ask if he can teach spiderman to swim underwater? He didn't appreciate having me dress him as a toddler. I planted a small toy for him to search for inside a sleeve (the second sleeve, of course). He resists bedtime, but loves story time. I have him help pick out a book to look forward to, then I sit on his bed an start reading it when bedtime arrives. He can't resist, and climbs in beside me.
… 2. Participating in a task, like picking up toys, alongside him, with a cheerful attitude. This is really important (adult modeling is the prime predictor of a child's future attitudes). My participation, which may be small because my back hurts, keeps him from experiencing the task as joyless and lonely and too big to accomplish by himself.
… 3. Giving advance notice that you'll need to have X done pretty soon. Then notice again that X will need to happen in one more minute. Then time for X arrives, at which point, I move into steps 1 and/or 2. Transitions tend to be hard for young children, and this helps them prepare emotionally.
… and realizing that kids just don't "get" the need for busyness and schedules. When I spend a day with my grandson, I deliberately throw as much scheduling out the window as possible, so that he's not always being rushed from one thing to the next. I think it probably helps him "reset" and relax a bit from the usual hurry of his working parents' weekday.
… 4. When something really must happen now, be as inevitable as the tides. The ocean doesn't get hung up on judgement, resistance, drama or anger. It just rises, calmly and implacably. If my grandson won't get his jacket on, or come to the table, or pick up the toy cars after my final request, I get the jacket, or guide him to the table, or bring him back to the toys and make a game of picking them up. All cheerfully, with a smile. My attitude can make the difference between a long, drawn out episode, or the satisfaction of having done what's necessary.
Finally, we learn to anticipate the problem areas, and have a positive strategy in place ahead of time. Sometimes it helps to talk over those situations before they arrive, and ask the child to help with the problem solving – this becomes easier as the child becomes more verbal. In the case of a head-banging tantrum, I sense it might be helpful to tell the child that you recognize he can't always deal with his feelings safely, and when that happens, you will move him to a safe area and just wait quietly until he's through. Then when that happens, he'll know you're watching out for him, even if you don't otherwise react to all the drama. Not dealing with a problem until it's in full swing is baffling and frustrating, for both you and your child.