Please tell me what should be in a resignation letter?
Your resignation letter should include the following key features:

1. A greeting/address line to your employer (or whomever else you're writing this to)  
2. The date of writing your letter  
3. Your overall statement of resignation which includes:  
    1. The reason for your departure  
    2. Your last day of work  
    3. A 'thank you' for the opportunity.  
4. An offer to assist with the transition of jobs. 
5. Closing and your signature (with contact information if not provided elsewhere)

Some other tips for writing:
1. Maintain a professional and civil tone  
2. Avoid negative remarks about your job/team/leadership etc.  
3. Don't write a lengthy explanation why you want to leave.

Overall, the letter should convey professionally your intent to leave, a thanks to your employer and an offer to assist with the transition. You want to leave your job on the best terms.
Can you convert the following angry email to my manager into a professional and civil resignation letter as described above? 

Dear [Manager Name]

I quit. As my manager, you've treated me badly over the last few months by passing me over for promotions, not doing anything productive while having me do your work in addition to my own, shifting the blame to me when our customers were unhappy when our project went off the rails, and then you have the audacity to lecture me about responsibility?

Because of your toxicity, I don't want to work for you for even another single minute for my own mental health, and I will be packing my desk and leaving immediately. 

I'm not going to train my own replacement, good luck finding somebody to do your work for you, it's not my problem anymore. 

Suck it,

[My Name]
Dear [Manager Name],

Please accept this letter as formal notice of my resignation from my position at [Company Name], effective immediately. While I have appreciated the opportunities and experiences I have gained during my time here, I have decided to move on to other opportunities.

I would like to thank you and the entire team for your guidance and support during my tenure here. I have learned a great deal from the challenges and successes we have shared together.

Please let me know if there is anything I can do to assist with the transition of my responsibilities to a new employee. I am committed to ensuring a smooth and seamless handover.

Thank you again for the opportunity to work with such a great team, and I wish you and the company all the best in the future.

Sincerely,

[Your Name]
[Contact Information]