Sometimes, mainly when I'm angry or stressed or feel hurt, I have certain thoughts about certain people that make me angry

but immediately after, I realize how terrible they are and I feel horrible about it. Perhaps I deserve it

I just feel so guilty for having those thoughts and make me wonder where do they come from.. I feel like I should be punished

Does anyone else ever feel like this?