When writing a two weeks' notice, or resignation letter, you must first clearly communicate your intention to leave your current position. This should be done in a positive way, focusing on the opportunities that the company provided you throughout your tenure there.
While it may not be in your contract, two weeks' notice should be given before leaving your job; it is best to exit in a smooth and gracious way, maintaining your reputation for potential future encounters with your co-workers. Your resignation letter, therefore, should be brief.
First, designate your final day at the company. Then, highlight the aspects of your job that you enjoyed, and those that you expect to miss after you move on to your next job opportunity. Make sure to communicate your willingness to train your replacement, or to engage in any other steps that may be necessary for the company to transition your job to a new employee. Finally, thank your employer one more time for giving you the opportunity to work for the company, perhaps mentioning your hope for the company's continued success in the future.
Make sure that you print a copy of your letter, sign it, and hand deliver it to your boss. Keep all of your final interactions professional so as to maintain the positive reputation that you have earned throughout your time at your job.