As a teacher, you are a role model for your students, so you should actively listen when communicating with them. Make eye contact and nod your head affirmatively to let them know you're engaged. Give occasional statements like "I see," "okay" or "go on" to signal that you follow what they're saying. When the student is done speaking, briefly summarize what they said, and then respond with your thoughts. This kind of attention will make your students feel cared for and important. It also shows students how to listen attentively.
Students can show you that they're paying attention in class by making eye contact while you speak, nodding or (if you're lucky) laughing at your jokes. On top of that, students can listen actively by taking notes in class. If you teach elementary or middle school, you may need to write facts and definitions on the board for students to copy in their notebooks. If you teach high school or college, you can give lectures, shows videos or provide PowerPoint presentations and expect students to write down the pertinent facts on their own.
Contrary to popular belief, talking in class is only a problem if it's off-topic. Teachers should encourage student participation that includes asking relevant questions, answering teacher-posed questions, discussing learning material and responding respectfully to each other's comments. This promotes active listening and speaking skills, as well as critical thinking ability.
If students struggle with listening in your classroom, consider doing role-playing activities that model both poor and good communication skills. Divide the class into teams of two, and ask one student per team to tell a story (about a favorite birthday memory or an embarrassing moment, for example) while the other student "listens" using poor listening skills. Then repeat the activity, asking the listening students to actively pay attention this time. Finally, meet as a whole class to discuss what poor and active listening look like, respectively. List the qualities of good and bad listening skills on the board. Discuss why active listening is important, and require students to practice this skill in your classroom.