Any English class, be it a grammar class, a listening and speaking class, a writing class, or a test prep class, is affected by the teacher who is teaching it. No matter what they’re teaching, many teachers have a tendency to go off on tangents that seem unrelated. How do you prepare yourself for all the tangents your teacher will go on in any EFL class?
The obvious answer is: you can’t. But just because you cannot prepare for learning things from your teacher’s tangents, doesn’t mean that you can’t get something out of them.
In normal, everyday conversation the topics are not planned (for the most part) and they flow from one topic to another extremely fluidly. The same goes for some portions of your ESL classes; the teacher transitions from one topic to another because s/he thinks that the tangent will be useful for the students. Really, by allowing your teacher to go on tangents in class and paying attention, you are training yourself for normal conversation with other English speakers.
So take advantage of teachers’ tangents and the random knowledge, vocabulary, idioms and even grammar that you might learn on a whim!