Simply replace the unfilled areas such as "" and "[date]" with your information.
Dear [name of instructor],
I just wanted to thank you for the class this semester. It was one of the most enriching experiences of my life.
I've had a lot of teachers and most have been pretty poor, to be honest. A lot of people do it for the wrong reasons--paycheques, they don't know what else to do, a general feeling of wanting to take over the world but not having the might to do it otherwise.
Anyway, thank you. Best of luck in the future.