A magistrate can be any number of things; magistrate judges in federal court, for example, are judges who preside over procedural and discovery issues during a federal lawsuit and report their conclusions and recommendations to the district judge. A magistrate may also be any other government official appointed by statute with a limited role. If you want to write to a magistrate judge, use a formal letter-writing format and make sure to address the judge properly.
TL;DR (Too Long; Didn't Read)
To write a letter to a magistrate judge, address the letter to her at the courthouse, using the judicial honorific, which is "Honorable <First Name> <Last Name>, Magistrate Judge." Open the letter the "Dear Judge <Last Name>:" and close it with "Respectfully submitted," rather than "Sincerely" or something similar.
Formatting the Letter
Type the judge's name (which should be "Honorable <First Name> <Last Name>, Magistrate Judge), the court name and the court address below the date at the top of the letter. Next, type "RE:" and after that, your case name, such as John Doe v. Jane Q. Public, and the case number. Below that, type "Dear Judge <Last Name>:" and then add another space below it before starting the body of the letter.
The Body of the Letter
The rest of letter should explain who you are and why you're writing. For example, if you're writing because you missed your court date and are requesting a continuance, begin by identifying yourself; then apologize for inconveniencing the court and explain why you missed your hearing. Provide details about the situation and request a continuance. Finally, thank the judge for his time and provide contact information for yourself.
Closing the Letter
Close the letter by typing "Respectfully submitted," and skip three lines. Type your full name. Print the letter and sign above your typed name. Address the envelope to "The Honorable (Full name), Magistrate Judge," followed by the name of the court and the court's address. You must send a copy to all other parties to the lawsuit.
If you have an attorney in the case, you should, in the lower left corner of the letter, type "CC: <Attorney's Name>" before sending, and send a copy to your attorney. If you do have a lawyer, you should talk to him before you send a letter directly to a judge.