One of the best things that my parnter and I try to do, is say things like "I'm sorry, I'm not mad at you, I'm mad at $x" or "I'm sorry, I'm just really hangry right now, can we talk about this later?"
When I say those things, not only does it help my partner understand, it also helps me internalize how true it is.