I basically use two ways to
teach grammar - by grammar teaching, I mean those aspects of grammar whose rules do not come out easily like conditionals, gerunds etc. First is rule and then practice or the second way is to give an example and ask students to decipher the rules.
For most beginner to elementary students, I most often won't teach them
grammar rules unless it was absolutely necessary.
Even when I do, I don't spend too much time on it. The rule is then followed by a barrage of
communicative grammar practice exercises.
From pre-intermediate and above, I may spend some time, longest 5 mins explaining some complex rules with lots of controlled practice at first. I remember trying to explain the
zero, first second and third conditionals. It is grammar points like these that take about 5 mins to explain. But usually I do it in stages, followed by practice. Then when students have mastered using say first conditional for example I laugh and tell them, something like " Just when you thought, you have mastered your conditional sentences, another kind of conditional sentence steps in - the second conditional. "
Then I can show the difference between first and second and also give them circumstances when we would use them. Again practice follows every explanation. It could be a game or some activity to reinforce the rules learnt. Usually, a smart student will come up with a smart exception-to-the-rule question. This is when you tell them about rules always having exceptions just like with every rule. With my chinese students, I bring out examples from Chinese which I know much about. Then they see that this is not just an English problem but a language problem. By teaching rules of grammar we raise language awareness for the students and reduce the chances of making the same mistakes all through the different levels.
Don't over correct grammar mistakes though. This is especially true in communicative activities. Also, when you do correct try to make it not look that way. I often repeat the correct one during or after their speaking but I do not stop the student to say -this is wrong.
Grammar rules also need to be taught because most foreign language learners ask several "whys" when they come across some never-before-seen grammar. For example in the Chinese language, verbs do not change. English verbs change form several times.The verb "go" for example can change form several times in English - go, went, gone, going. In Chinese this never happens. Imagine teaching verb tenses to these students. Anyone who has taught Chinese students will find that the students demand an explanation when you use a change in tense. The beginners are most often taught present simple and present progressive, but when they start getting into pre-intermediate, they find it hard to break away from using the present tenses for every time change- after all the verbs do not change in their language and the meaning can still be communicated using a time expression like “yesterday, last month etc”.
For students to speak correctly, this needs to be taught and practiced.