Feeling jealous is painful. Feeling jealous and then being shamed or punished is confusing for a child. And it doesn't equip them to know what to do with the feeling.
When your child feels jealous they need the same set of things they need when they feel any other painful emotion.
1. Empathy and support understanding their emotion and learning words to put to it.
2. Help regulating their body.
3. Compassionate guidance on how to cope with the feeling.
Jealousy is not a character defect. It's a normal and complex body state that abates when it is acknowledged and the person feeling it is given emotional support to handle it and not act it out.