Use chastise correctly in a sentence

The teacher had to chastise the student for talking during the exam.