Prepare for It. Your best option in this scenario is to accept it with dignity and make sure you're ready to leave the office for good when you turn in your resignation letter, whether that means gathering up your personal items or making sure you've collected the names and contact information for the teammates and clients you'd like to stay in touch with.
A Gracious Tone. Your resignation letter is not the time to air grudges, take passive_aggressive shots, or otherwise be unpleasant. Regardless of how you feel about your (soon to be former) job or your boss, this letter should be an exercise in professionalism and graciousness. An excellent way to do that is to say a simple "thank you." Even if you hated your job, you got something from it at some point. Focus on that positive bit if you need to.