Yelling at children happens to most parents occasionally — stress, exhaustion, accumulated frustration. The yelling itself rarely damages relationship long-term; pretending it didn't happen does. Apologising afterwards models accountability and repairs the moment.
What to say
'I yelled at you earlier. That was about my stress, not about you. I'm sorry. I'll try to do better.' Brief, specific, doesn't burden child with managing your emotions.
Most parents fear apology undermines authority. Usually strengthens it. Children of apologising parents have better emotional regulation as adults.