Errors are a natural part of the learning process. For example, an elementary student who says "I taked the bus yesterday" demonstrates that they have learnt that an "ed" ending denotes a past tense. They just haven't learnt the irregular verbs yet.
Some errors are slips of the tongue, eg "I forgotten to do it". In this case the learner knows the correct answer but forgot it momentarily or it just came out the wrong way. Native speakers also make this type of error.
As a teacher, your job is to distinguish betwwen the different types of error and decide which need to be corrected given the level that your student is at. For this, you can consider what you have been working on recently in class and which you think the student should have mastered by now.
When you've decided which errors to correct, think about who corrects it. Try to give the student a chance at this first. This allows them to show whether they know it or not. Also having a second chance at producing the phrase reinforces the learning process. If the student doesn't get the right answer, you can correct it yourself or ask someone else in the class to try . You'll also need to consider how much time you want to spend on this. Having the teacher correct is usually the quickest.
Think about the activity you are doing. If you are doing a speaking activity to practise fluency (ease of speaking naturally) you might not want to interrupt the flow. In which case you can make a note of the error and go over it when the activity is finished. If your aim is accuracy, a better choice would be to deal with the mistake immediately. Also, if you hear the same mistake being made repeatedly, it's better to correct it sooner rather than later.
Another thing to consider is how you indicate that a mistake has been made. Will you let the students know that something is wrong and allow them to find it for themselves? Or will you tell them where the mistake is? Things to consider here are the amount of time available and how successful you think they will be at finding the mistake.