It's far better to write a good resignation letter than it is to be disfellowshipped, even though the net result is the same. JW's are required to shun you whether you leave with a resignation or you're disfellowshipped but there's a big difference.
The difference is that you took action to end your relationship with the Watchtower before they had a chance to disfellowship you. Even though this difference seems to be trivial, it is in fact an important difference that affects the rest of your life. Here's why.
JW's are taught that JW's are shunned because they committed a 'gross sin'. However if your resignation letter contains proof that the Watchtower is a false religion, you now have a powerful tool to defend yourself against future accusations that you were immoral and evil. It also puts into question the Watchtower's right to ask JW's to shun you based on the facts in your resignation letter.
Be brief. Don't ramble. One page should be good enough.
Use bullet points. Make it super easy to read. Large print is preferable.
Give clear, concise reasons for resigning that proves beyond any doubt that the Watchtower is a false religion.
You should always give solid, undisputable reasons for resigning. This way no JW can fault you or intelligently argue with your reasons for leaving. If you write your letter properly and they've read your letter, some JW's may continue to have a relationship with you, even if they do so secretly.
Here are some logical and easily proven sample reasons for resigning from the Watchtower.
Deliberate deception that JW's must fully cooperate with the 144,000 because they are leading the organization as God's faithful and discreet slave. Today the organization admits that JW's have been following a few men at Watchtower headquarters since 1919. 
The Governing Body & it's Elders require full cooperation, obedience, and submission contrary to what the Bible teaches. Acts 5:29; 1 John 4:23,24; John 4:17;  I choose to respect and love all people. However obeying humans is a sin against God. It is idolatry. Jehovah requires me to be loyal to Him alone.
False Watchtower predictions about armageddon. (List dates of failed predictions.) 
The Watchtower judges and hates 'enemies'. This is a rejection of Jesus, who is the path to eternal life. Luke 6:27-41 
If you got baptized after 1984, you can say your baptism into the Watchtower religion is not scripturally valid. 
Hypocrisy. e.g. The Watchtower has condemned the clergy for molesting children and Elders are now guilty of the same crime. Victims are disfellowshipped and shunned, while the child molesters are protected. (Cite proof or don't use this reason at all! The court documents are all over the internet but if you believe JW's will argue with you about the wide spread nature of child abuse in the organization, don't use it.)
The Watchtower teaches shunning in order to silence JW's and prevent them from considering information that proves the Watchtower is not God's organization.  
Make up your own good reason(s) for leaving.
Imporant: It's better to resign for one or two solid reasons no one can argue with, than list five or ten reasons that are not as obvious to the majority of JW's in your local area.
Please modify your letter and make it your own. This is a sample letter outlining how brief you should be. Perhaps you can write more than one letter if you like. e.g. one to Elders in your congregation, one to Elders in other congregations you've attended, and one to Watchtower headquarters.
After stating the date, your name, and to whom the letter is addressed, your letter should simply state the following.
"I hereby formally resign from the Watchtower and organization of Jehovah's Witnesses for the following reasons." or "My Bible trained conscience will no longer allow me to be affiliated with the Watchtower organization. I formally hereby resign for the following reasons."
Then briefly state one or more reasons. Use only one or two sentences for each reason. Ideally your entire resignation letter should be easy to read and no more than one page long. It should take no more than 2 or 3 minutes to read the entire letter and clearly understand your reasons for resigning.
So that it's clear that you're not angry or bitter, you should state your reasons without blaming anyone or judging. Be unemotional. You could end your letter with 'God Bless' or 'Christian love', or in some other way to make it clear you're not leaving God. You're leaving your religion for solid reasons and your conscience will no longer allow you to be a JW.
If you write your letter properly, for the rest of your life, no one can accuse you of being disfellowshipped for immorality or 'gross sins'. If someone doesn't believe you, simply produce a copy of your resignation letter. It will state your real reasons for leaving.
JW's will never have a valid scriptural reason for shunning you if your resignation letter proves the Watchtower has deceived Jehovah's Witnesses and that's why you're leaving. Who can fault you for putting God first and speaking the truth? Only those 'dominated by Satan' (as the Watchtower would say) will reject you. And if they reject you, do you really want them in your life?
1. False Watchtower teachings about the 144,000 since 1919. Watchtower quotes proving they misled Jehovah's Witnesses for decades.
2. False Watchtower Predictions from 1889 to 2008. Proof in their own literature that they are a false prophet.
4. Baptism Vows of Jehovah's Witnesses have not been scripturally valid since 1984.
5. 2013 Convention of Jehovah's Witnesses. Shun Your Family (Video) Jehovah, Jesus, and JW's who leave are blamed for breaking up families. The Watchtower assumes no responsibility.
6. Theocratic Lies. Watchtower quotes about hiding the truth from non believers, apostates, and JW's, ... protecting the organization at all costs, even if it means covering up incriminating truthful information.
7. Watchtower quotes. Obey Us