“How do I stay focussed in the viva?” has the same response as “How do I engage well in the viva?”
You check details in your thesis.
You ask questions.
You make notes.
You share the best responses that you can to provide context, information and demonstrate who you are and what you did.
Engaging well keeps your focus. Keeping focus helps you to engage well.