Frankly speaking, are you not paying enough attention to him? Causing him to seek warmth from people outside his family? It's normal for me to be close to the opposite sex at my age.
Usually, boys have a certain personality. So, your words may not work for him. So, talk to him about his girlfriend first and tell him your understanding of his practice. I don't know what effect love has on his study, but I don't think he can give up love. On the contrary, he can change his perspective. If two people study well, or one of them studies well, we can consider promoting both sides' enterprising to improve their grades.
In addition, understand the child's life planning. Know what she is planning. Support and understanding are more important for boys' education. It is more important to have a heart-to-heart talk. Don't judge your children simply and rudely. You should be a guide.
The last sentence, grasp the big and let go of the small, in front of the score, many things are not so important, the school teacher scolded the child, you should also express your support, understanding and absolute trust in him. After all, the teacher has only been with him for three years, and you are his eternal harbor. Let him know that you are proud of him.