For those of the age of reason, a very effective discipline was used in my day. (I’m assuming a physical condition is not the cause). Within 2 or 3 masses, the effects were noticed. Just threaten the loss of something the child cherishes and will lose after the mass. A sit in the corner of his room for an afternoon works wonders, or something of that nature. For those who think this too oppressive, we(the children in the community) received corporal punishment(Sirach) in our days. Works wonders, and he learns to be a better fit for society. You can’t be a softee for this to work, otherwise the lesson is not learned PLUS you get labeled as a push-over. They learn quick.
For the babies/toddlers, they seem to be more a problem during the sermon, as I wish to hear it, and I have bad hearing, but I can take it the rest of the time. Mom’s in my Church usually know enough to go to the back of the Church if too unruly.
But as a rule, we should be more tolerant, as the child is also a child of the community, and we all have a familial interest in his proper Christian development just as the parents promised he would at his baptism. We are to assist his parents in our attitudes. No child should miss a mass.
It’s remarkable to see an unruly child turn into a good boy or girl scout later. I’ve seen a few of them grow too.