Getting angry when my children disobey

Sometimes, with my children, I get angry when they disobey.
I now understand that the thought “they don’t respect me” or “children shouldn’t talk like this to their parents” creates this feeling of anger which leads me to yell at them.

But things happen very fast. I don’t have time to change my thought on the circumstance. And I don’t know what the next circumstance will be.

Could you help me with this?
Is there some kind of “freezing tool” which could help me?