1. Give proper notice.
If possible, give the appropriate amount of heads-up to your manager. For most jobs and companies two-weeks notice is standard but depending on your role and responsibilities, it may result in a smoother transition if you give them even longer. You definitely want to tell your manager in person (no sticky notes, emails, or texts) and then you should follow up with a formal resignation letter that outlines your last date with the company. You'll also want to discuss with your manager what the communication to the rest of the company, your teams, and clients will look like and when it will be shared.
2. Keep it gracious and professional.
Start off with gratitude - talk about the positive experiences and skills you gained in the current job and company. When you talk about your departure, focus on the opportunities at your new job/company you're excited about, not about difficult personalities or any gripes you might have at the place you're leaving. Stay away from gossip or negativity.
3. Don't leave the job before you leave the job.
Keep up your responsibilities. Do what you can to support the transition. You want to leave on a positive note, pitching in as well as you can. And these days, it's not unheard of for people to go back to their previous companies - it's called boomeranging. I've done it and so have my friends and clients! And companies acknowledge that while you may be leaving to grow new skills and experiences and networks, they can benefit from your move in the future by hiring you back.
4. Thank people.
Take folks for a walk or coffee one-on-one, especially those peers and mentors who helped you excel and stay motivated at work. Let them know the positive impact they've had on your job, career, happiness (and I bet they'll share the same with you)!
5. Keep in touch.
Develop a plan to keep in touch with these soon-to-be-former colleagues and build them into your professional network. Remember that these are colleagues, managers, and clients you may be working with again in some capacity or another, and/or you may need referrals or references from them.