Absolutely this^ with bells on!
There is a balance to be struck so that children are brought up with self confidence and good self esteem but they are also taught to think about how their behaviour affects others.
So before leaving home to go to a restaurant you brief the child about appropriate behaviour. “We sit at the table quietly because the waiting staff are carrying trays of hot food and drink and you could get hurt if you run around. Also, we don’t shout because other diners are trying to enjoy their meals in peace.” You can role-play it if they don’t understand. You remind them again about how to behave when you arrive at the restaurant before going in. And then once more when you are sat at the table,
Once at the table, or the side of the pool, or the play ground, you as a parent have to sacrifice your own enjoyment a little to be present with your dc and interact with them. Don’t just sit back and absolve all responsibility for your offspring’s behaviour. Waiting staff, instructors, and other parents are not there to baby-sit your child.
And if all goes belly up and your child has a tantrum, then you pack up and leave, even if it’s half way through something enjoyable. They don’t get to ruin it for everyone else.
The same applies to shops, theatres, school plays, etc. Even in doctor’s waiting rooms or on public transport you can usually get up and remove them from that immediate space for a few minutes until they have calmed down. And if it’s obvious that a child finds a certain scenario difficult to handle; then you practice in small bursts until they can.
And as a pp said, you do your children no favours if you bring them up oblivious to the feelings of others.