You can Google "character reference letter for court" and find several examples. Here is one site I found. http://www.buzzle.com/articles/character-reference-letters-for-court-appearances.html
The best suggestion I can give is be truthful and write from your heart. Copying a sample is not going to feel real to the Judge. The Court will be impressed by you stating how you know the Defendant and why you think they are a good person. Tell the Court how the person has changed since their arrest and the good things you have seen.
Nothing in this communication should be construed as creating an attorney-client relationship. I provide this service for educational purposes only. I will take no action on your behalf unless you have hired me and a written retainer agreement is signed. I am licensed only in Tennessee and I strongly suggest you consult with an attorney in your city and state as Statute of Limitation deadlines can limit your recovery.
The purpose of the character reference letter is to give the judge some insight on the kind of person the defendant is. Thus, a truly personal statement is likely to be more persuasive than general statements copied from a sample. You should also date the letter (I once heard a judge remark that he hated undated letters because he did not know if it was a current statement or one from ten years ago).
This answer is for informational purposes only. It is not intended as specific legal advice regarding your question. The answer could be different if all of the facts were known. This answer does not establish an attorney-client relationship.