When you attend a great class, when a professor does you a favor or writes you a letter of recommendation, it's always a good idea to thank him. Decide whether to talk to him in person or write him a card or email. Specifically mention the memories you have and the examples that come to mind. Respect the rules of etiquette and don't forget about education.
Steps
Method 1 of 3: Express Your Personal Gratitude

Step 1. Approach the teacher after class or during office hours
Use these opportunities to talk to him. Meeting him in person gives you the opportunity to converse with him or thank him if you wish. In addition, it will also serve to help him associate your face with your name.
If you want to create or maintain a professional relationship with your teacher, thank him in person, so that he can get to know you better

Step 2. Start with the acknowledgments
Get straight to the point and start with "Thank you". In this way you will immediately clarify the reason for your visit and the professor will not have to ask himself why you approached.
For example, you can say, "I wanted to express my gratitude for your lesson", or "Thank you for writing my letter of recommendation."

Step 3. Be specific
If something has impressed you a lot, about the professor or his class, let him know. For example, mention a lesson you enjoyed, a field trip you learned something, or a dialogue you will never forget. Mentioning a specific episode shows that you have reflected on your thanks.
For example, you can say, "I'll never forget his first lesson. I knew I would learn a lot from his class, because he got into it right away from day one."

Step 4. Be polite
This is not the time to be too casual with your professor or to try to be friends with him. Behave with education and professionalism. Don't even use your thanks as an opportunity to make a request or to be rude to the professor about another matter.
Method 2 of 3: Give a written thank you

Step 1. Write a clear subject for your email
Do not forget the subject, so that the teacher knows what the purpose of the communication is as soon as he receives it. If you don't put it on, they may not read your email or think you want something or have a question. Make it clear right away that you are writing to express your gratitude.
Write a simple subject, such as "Thank you" or "Thanks"

Step 2. Use your student email address
Don't use your personal one when sending something to your professor. The student email is more formal and allows the teacher to identify you easily. It is also more professional and appropriate, so you won't run the risk of using an extravagant or silly address.
Make sure you send the email with the right account

Step 3. Contact the professor formally, with the full name
Don't start with "Hello" or skipping pleasantries. Begin by greeting the professor appropriately. Usually, you will have to choose the same form you use in class, such as "Professor Rossi" or "Dottor Bianchi".
Don't call him by name and don't forget to greet him appropriately either. Use the form in which students address him

Step 4. Write a card by hand
Such a communication may be more welcome than an email. While it's not quite as quick, it shows you've taken the time and effort to express your gratitude. Plus, you can compose a more personal message.
Give the card to your professor at the end of the semester or put it under the door of his office

Step 5. Submit your thoughts via the internet through the university's website
Some universities allow you to write letters of thanks to professors via the internet. If your school offers this service, take advantage of it. Often, you can even leave anonymous tickets.
Method 3 of 3: Express the Reason for Your Thanks

Step 1. Thank a professor for teaching you well
If you have been positively impressed with the education you received and believe that a lesson was exceptional, let your teacher know. It may have made a boring topic exciting, or it may have managed to engage students in class. Whatever the reason, let him know that you appreciate his efforts to offer you a wonderful lesson.
Even if it was very difficult, let the teacher know that you have learned a lot and that you have tested yourself

Step 2. Show your appreciation for a letter of recommendation
When applying for a master's degree or for a job, you often need letters of recommendation. If a professor agrees to write you one, send him a thank you letter when he's done. Composing a recommendation and mailing it takes effort, so let him know you appreciate his help.

Step 3. Thank him for his help
If the professor has helped you in some way, it's a nice gesture to acknowledge his contribution. It may have given you insights into the best choices for your career, or suggested valuable sources. If he helped you out, let him know you appreciated him.
For example, it may have helped you choose a master's degree or suggested which classes to take

Step 4. Thank him as soon as possible
It is best to express your gratitude immediately after receiving a favor from your professor. Don't wait weeks or even days. Prioritize the message and write it as soon as you can. Usually, your thanks should be received within 24 hours.