My wife and I used to tag-team. Only one person got to lose it at a time. As soon as one person got that distant, exasperated look, Parent 2 jumped in and Parent 1 could go cool down, watch a show, have a drink, or take a bath. If solo, we’d use distraction and humor. If too much, you stick them in a playpen with toys and let them self-sooth.
If it’s any consolation, they won’t remember diddly-squat of anything that happened before ages 5-6.
They’re too young to remember, so I wouldn’t worry. But next time something happens, you can demonstrate how to deal with adversity. If a glass breaks, or something catches fire, or the shower overflows, you can freak out and yell, or shrug and tell them ‘accidents happen.’ Just clean up and move on. It’s not the end of the f’ing world.
This way, they grow up to be a lot more chill, resilient, and capable to handle adversities in life.