Although this is a formal letter in as much as it is classed as a business letter, a thank you letter indicates that you are already in contact with the recipient, so this letter can take a fairly informal tone. A business thank you letter format is not something that is absolutely set in stone, but for the benefit of people who are not used to writing such correspondence, I have included a sample business thank you letter format below which will guide you through writing such a letter.
Dear (insert contacts first name),
Paragraph 1: Many thank you letters will only include one paragraph due to the informal nature of the letter. In this paragraph you should start off by introducing yourself to whoever you are writing to. Use a second sentence to thank the person for what they have done. A third sentence can then explain why their work was so helpful to you, and how it has benefitted you or your company. You should keep this paragraph business like but friendly.
Paragraph 2: If you decide to use two paragraphs, then this one will be a short simple paragraph reiterating your thanks, and perhaps mention that you are looking forward to working with them or seeing them again, whatever is appropriate to the letter.