Teaching and learning activities involve a series of activities carried out by teachers and students who act as actors in education. Both of them interact with each other to achieve predetermined goals. The relationship between teacher and student is inseparable from the components that support ongoing learning activities. The teacher-student relationship is also a protective factor against the emergence of violence in schools. However, sometimes this violence often occurs in educational settings. So, in this study, a researcher will analyze the teacher-student relationship through the thoughts of Imam Al-Ghazali from the Book of Minhajul Muta'allim in dealing with violence in the educational environment. This research is qualitative, using the descriptive-analytical method. and this research is also library research, using content analysis as a data analysis technique because this research relies on text and aims to describe the results of the research. This study explains that Al-Ghazali as a Sufi with a philosophical background has a philosophy of education concept. Al-Ghazali colored his thoughts referring to the basic concept of ethics which is better known as "moral education" which is in line with the goals of education proclaimed by Al-Ghazali, namely to form full-time human beings who aim to get closer to Allah SWT and get happiness in life in the world and the hereafter because of education. According to Al-Ghazali is to eliminate the bad morals of students and in still have good morals in them. In his thinking about the teacher-student relationship, both of them must have a sincere intention in studying and teaching knowledge as well as purifying the soul from despicable morals and bad traits that can eat away at the heart. So as long as the heart is not cleansed of vile things, it will not be easy for it to receive beneficial knowledge. So that it can avoid the occurrence of acts of violence in the educational environment and create an ideal education with a divine foundation and prioritize morality and then the intellectuality of students.