I think a time out can be a really useful tool for a child to begin learning how to separate themselves from a problem in order to calm down. We call it taking a break to get calm and if the child can be safe during it, we stay with her. If not, we as parents take a break for a few moments to gather our own calm before trying again.

My child is introverted and prefers to be alone to deal with her feelings usually, particularly after about age 3.5 I actually struggle with this a bit because I want to connect, help her process, etc, but she doesn't benefit from that. We've set up a small area of her room for getting calm at various point. For awhile it had a list of ways to help herself - counting, breathing, etc - along with a little music box, a glitter jar, some other stuff.

So imo, it depends a lot on the message. "You don't get to be with other because you are having a hard time, go figure things out" is a lot different than "You are having a hard time, let's help you get calm." The second also empowers the child to do these thing on their own as they mature, providing tools and skills instead of shame and punishment.