From my limited working experience (thus far) one of my all time advice is to write your resignation letter on day one. Yes, the same day you got the job. This gave me a sense of power over the quality of treatment I know I deserve, which is just simply respect. Respect for my time, effort and skill.
By the time you get around to writing that resignation letter later down, your managers, execs etc can and will gaslight the hell out of you to the point where it’s a heavy and daunting task to draft your exit email. Do it when you’re fresh and confident. Not after you’ve been burned, disrespected and dejected.
Work is not your life. It’s annoying system for us to feed, clothe and house ourselves.