From experience, the clear answer is - not at all. One should never try to correct people when they are in the process of talking.
It has the following effects -
Yes, even for a teacher, it is very tricky to do it in a class, as the student may be made fun of by others. This is a typical Indian habit, and an ugly one at that. The whole class may start giggling or smiling, and will make it miserable for the student concerned. So one has to then pull up everyone and teach them manners, not something to be done frequently.
So how should it be done?
For standard errors, a teacher can address the class as a group, without anyone making a mistake. A classic case is of the word "definition". Most students spell it as "defination", which is clearly wrong. Another is millennium, that mostly is written "millenium" by people. One can go to the extent of explaining roots too - for example mill(a thousand) and enn (year) that would make it permanently fixed in their minds.