It honestly is quite simple. “Mrs crisps can I please go to the toilet?”
“Hmm. Would you be able to wait five minutes until I finish this demo?”
Either eyes widen and you get a “no. I need to go now” in which case off they rush. Or they forget in five minutes because they didn’t need. I have done that then reminded the child only to be told by the child that they don’t actually need anyway.
And maybe I am a soft touch. Maybe I teach a bunch of weirdos but sometimes they need a bit of a break. A stretch of the legs and some fresh air can actually help. I’m not checking bowel or bladder contents!
If they ask regularly I remember and I warn when they ask that they may not get next time. That helps them regulate.
And I know this sounds extraordinary but I have been known to pop to the loo for a quick pee when I have older classes in and generally speaking the Sky doesn’t cave in.