It is important that before teaching about issues like mental health and emotional wellbeing, clear ground-rules are established, or subsequently reinforced and the concepts of confidentiality and anonymity covered at the start of the lesson.
Ground-rules need to be consistently adhered to, regularly revisited and, if necessary, renegotiated and reinforced. The teacher should lead the way by modelling the ground rules in their own communications with the class. Where time allows, ground-rules are most effective when they have been negotiated and agreed with the pupils, rather than imposed by the teacher.
The PSHE Association have put together a useful guide to support in negotiating ground-rules and the use of distancing techniques, which you can download here: