Pairing with someone less experienced OR keep your hands off their keyboard
Having people of mixed experience can be a great learning experience for both more and less experienced developers.
The less experienced developer might get some guidance on different ways of approaching a problem and gained confidence from seeing someone much more experience also struggle.
The more experienced developer might gain insight from the question’s asked and get a glimpse outside of their own expert context.
But one thing will ruin this wonderful chance. That is the more experienced developer grabbing the keyboard.
Even if you have to just tell them every character to type this is preferable to you disempowering them by taking their tools away. They can’t even be trusted to type what you tell them to.
This is hard, but sit on your hands, or bring a fidget toy, just stay away from their keyboard!