My professor gave me a project and I have completed it successfully. Now he has told me that he will get funding for my project.
I am so excited about that. How can I write a thank you letter?
If I'm understanding you correctly, you worked on a trial project, it went well, and now you will be continuing work with a funded follow-on.
This doesn't really strike me as a situation that needs a formal or complicated thank you note. Just tell the professor that you're happy things have gone well and are looking forward to continuing to work with them. The best possible thank you that you can give is to continue putting in good effort as you continue to develop your work with this professor.