My kids are still young, 12, 9 and 7 months.
As I am human, I sometimes lose my temper with them (the older two anyway). Then, I calm down and apologize and we talk about the behaviors that were inappropriate on their part AND on mine.
They see that yep, even adults can lose their tempers, but that when we do, we can apologize from it and try to learn from it.
I had a great childhood. My parents were awesome. I still ended up attempting suicide when I got to adulthood.
Was it their fault? Absolutely not. It was the fault of mental illness caused by a chemical imbalance in my brain.
Sometimes, it just happens.