Is it a sin to think or say hurtful and mean things about someone in your head when you're angry, but you keep silent and do not utter those hurtful or mean things to anyone and you restrain your anger? Will Allah punish us for our thoughts? Sometimes I get angry and have to express my anger in my head, but I do not say the hurtful things that that I say in my head to anyone and I always feel remorseful for saying those things in my head after I am not angry anymore.
The person who thinks of something evil and doesn't act upon it, Allah doesn't place them a sin but only a reward however if you keep thinking about it intentionally not only it makes you feel bad, it can lead the evil actions. So think positive, try not to let it get too you as Satan has evil plots and at the vulnerable times it takes advantage of you.