Teach him how to use his words... and how to communicate.
You may even have to tell him the words he can use.
Does he know his feelings and the words for it?
If not, you need to teach him that.
And role-play and practice with him.
This also has to do with "coping-skills" which some children do not have. It is taught. Some adults don't even have coping-skills.
It is taught. And practiced.
Teach him to say things such as "I am frustrated because...." , "I am sad because...." and then WITH him, help him find other ways of reacting.
It is practiced. It is not an inherent skill in kids.
My son is 4.. and he will actually tell me "I'm frustrated....because...."
Because I practice with him and taught him about feelings and the words for it. Once I told him when he was in a grumpy mood "Are you irritated?" and he said "No, I'm frustrated..." he knows the difference between him being 'frustrated' or "grumpy' or "irritated." And he will say it. Instead of whining.
Children also have to be taught... that there are MANY different ways, of problem solving and reacting. Practice it. They don't know that automatically. It is a learned skill. Over time.