People resign for multiple reasons—frustration with the current role, a boss who's driving them crazy, office politics, pay package, personal commitments, etc. Do remember that besides the why, it's how you resign that impacts your future relationships with people, who in all probability, may be in a position to influence your career at a later date. One hears of people resigning via a quick email or those who stomp-off after a yelling match with their supervisor.
Resigning gracefully involves
Read your contract/employee handbook. Make sure you clearly understand the departure formalities and do not act against any company rule. Remind your employer about your date of joining, and of the notice period written into your contract.
First, the boss
Schedule a meeting with your boss and discuss your reasons for moving, without bringing any negativity into the conversation. Never resign via email, or worse, by leaving a voice mail message. Always resign in person. It's likely that your boss might get upset at the thought of losing you. Offer to help in hiring your replacement.
Next, the letter
Draft a formal letter, thanking your employer for the opportunity to learn new skills and requesting them to relieve you as you would like to move on. No matter how much you hated your job or your boss, ensure that your letter is not controversial and does not appear like an attempt to negotiate a better salary. Remember, this letter will remain on the company's records long after your anger has subsided.
Now, inform your co-workers
The worst way to announce your departure from a company is through the grapevine. Inform your co-workers, but resist boasting about your new dream job, making them feel terrible about being stuck in the same place. Send an email to colleagues you've interacted with and leave your contact details.
During the notice period
Offer to help the new incumbent to settle in, complete pending tasks assigned to you, and leave a detailed report of hand over. If asked to participate in an exit interview, be honest, but state your reasons for leaving in a business-like manner. Hand over all office property in a good condition and clean up your desk/laptop.
Don't burn bridges
Leave gracefully, ensuring that your boss and colleagues give you a good reference in future. It's a wired world and seniors are often connected. Do consider that in today's evolving world, your current boss may become your employer again.
At the new job
Update your online contacts and speak about your ex-employer positively.