The secret to being a great teacher is quite simple. Be a student.
The best teachers are not those who believe they know everything, but those that are continually learning. This is because learning affects you in so many positive ways. Teachers that continue to function as students tend to keep their passion for their subject burning within them. As anyone who ever has had a passionate teacher can attest, even if you hate the subject, watching their enthusiasm can inspire you to at least try whatever it is they are doing.
Teachers who continue to learn don't fall behind in current events on their subject. For my subject specifically, mathematics, it seems that everyone only knows the name of a few ancient Greeks as if they were the only ones who studied math. But really, there is new understandable math being created every day. Getting a twitter to find and follow mathematicians and teachers was probably one of the best decisions I could have made. It has kept me very up to date in the math world. In fact, I find fun new things almost everyday and my collection of math resources is growing at an almost overwhelming rate (not that that is a bad thing).
Lastly, teachers who continue to act as students tend to have more humility. For them, there is not one right answer, but instead a multitude of possibilities. They understand that their students may not have had the same answer as them and the may not have gotten to it in the same way, but their answer could still be right and their method could still have value. The teacher learns from and about their students and is thus able to meet their students needs directly.
This isn't true only for teachers though. This is true for everyone. No matter who you are, it is invaluable to keep the mindset of a student and a beginner. A true master of anything understands best of all just how little they know in this vast and complex universe. So to all who read this: please, allow me to learn from you. There is much that I do not yet know.