Being polite and honest will Be your best bet to thanking a teacher for helping you out in a typical situation.
5.3m questions
6.9m answers