The most important thing to remember when writing a formal letter is to focus on the recipient. Write the letter with the recipient in mind, and make sure that you are addressing them appropriately.
When addressing the recipient, you will want to use their full name and title. For example, if you were writing to a business associate, you would want to use their full name and job title. If you were writing to a friend, you would want to use their first name only.
Once you have the recipient's name and title, you can start the letter. The first line of the letter should be formal, such as "Dear Mr./Mrs. Smith." The body of the letter should be concise and to the point. Avoid any friendly pleasantries, such as "How are you?" or "I hope you are well."
Once you have said what you need to say, end the letter with a formal closing, such as "Sincerely" or "Thank you for your time."