How do I thank him?

I took a senior seminar class, it’s required to graduate, and my teacher pulled some strings on my final so I’d be able to pass. I was very confused on the final project and faced a lot of set backs.

How do I email him thank you?