Formal:
* Pay attention to your teacher.
* Listen attentively to your teacher's instructions.
* Heed your teacher's words.
Informal:
* Listen to your teacher!
* Listen up! (This is more direct and can sound bossy)
* Pay attention in class.
* Hear what your teacher says.
More encouraging/positive:
* Listen carefully to what your teacher is saying.
* Try to focus on your teacher's lesson.
The best option will depend on the situation.