Carefully plan out your lesson. The instructor who knows what he/she needs to accomplish in class is less likely to become distracted than the one who doesn't. If you are confident in your plans you will probably see that the goals for a particular class are met. If you haven't taken the time to plan out a class, you're more likely to shift the focus of the lesson to students' thoughts and concerns.