Yelling usually starts after the fifth ignored request. You asked nicely. You explained. You offered a choice. Now your child is still pouring water onto the floor and your voice is doing that thing you promised yourself it would not do.
The answer is not to become endlessly calm. It is to make the boundary shorter and the follow-through more predictable.
Say less
"Water stays in the cup. If you pour it again, I will put it away." That is enough. You do not need a speech about waste, laundry or respect while a toddler is testing gravity.
If it happens again, put the cup away. Not angrily. Not with another warning. The consequence should be connected to the behaviour and something you can actually do.
Expect protest
A child crying because they dislike a limit does not mean the limit was wrong. You can be kind and firm at the same time: "You wanted more screen time. It is hard to stop. The answer is no."
Do not turn a no into a negotiation because the protest is loud. If there is a real choice, offer it early. "Blue shoes or red shoes?" If there is not, do not pretend there is.
Repair when you lose it
Every parent yells sometimes. Apologise without making your child comfort you: "I shouted. That was not okay. I was frustrated, and I will try again." Then keep the original boundary. Repair is not giving up.
For a child who is clinging, screaming or melting down, setting boundaries with a clingy toddler has more specific scripts. The point is not perfect behaviour. It is a home where everyone knows what happens next.

