Writing a resignation letter is usually a good idea when quitting any job, no matter if you officially quit the job verbally, over the phone or through an email. The resignation letter provides a physical record for the employer to reference later, and displays a professional attitude toward the employer, which then improves the chances of receiving a good reference for the next job. Resignation letters do not need to be complicated, just a date and reason are really needed.
When writing a resignation letter, it is best to avoid using negative language or referencing the bad experiences that may be the cause of writing it. Even if the job was the worst one that ever existed, the reference the employer gives is valuable for the next job and could mean the difference between getting hired or overlooked.
Submitting the resignation letter two weeks before actually quitting the job is a good idea. This is considered giving two weeks notice, which is a standard practice in many businesses and reflects positively on the employee. The notice gives an employer a chance to scope out a replacement. However, some work conditions do not allow for that much notice, and so it may be necessary to submit the letter on the same day work is intended to end. Including the reason for the abrupt decision informs the employer discretely.