When voluntarily leaving one permanent white-collar job for another, you perform these steps in this exact order for safety and professionalism:
- While you're interviewing, do quiet pre-research to figure out details about timing when you want to leave your current job. What is your required notice? (Two weeks is customary in the US if there is not a notice period specified in a contract or other agreement, see Do I owe them a two week notice?) Should you take some PTO or will it get cashed out, are there any option/RSU or bonus or 401k matches or medical insurance complexities that dictate when you should actually make the move?
- Find a new position and accept (ideally by signing and returning) a written offer letter. Don’t trash talk your current employer in interviews, it will cost you job offers. If there are any contingencies in the offer letter (passing background check, drug test, security clearance) negotiate that being done on their end before you give notice.
- When planning how much notice to give and agreeing to a new start date, you will be tempted and/or guilted into giving more notice at your current job because "you are so important" or "the project you are working on is so important." Don't, unless it is clearly in your best interest to do so. Try to plan for a week or two of downtime to mentally free yourself from baggage from the previous job and have time off because you may feel like you shouldn’t take a lot of vacation in the first part of a new job. Unless you can't afford a couple weeks without a paycheck or the new company says "it's absolutely required you start by date X," do it.
- Give the required notice at your current job, by telling your direct boss face to face if at all possible and then sending it in writing to him or her and HR. Serve your notice period in the way they want you to. They could walk you to the door, or ask you to focus on training, or just do your normal work, or slack, or make you do junk tasks no one wants to do - all are fairly normal, just do it. You don't need to go above and beyond, see Can I work just what I'm paid for while leaving?. In the very rare case they get super hateful and yell at you all day or make you lick their yacht clean or something else you can't cope with mentally, call in sick or just ghost them - the bridge is already burned.
- If your current company presents you with a counteroffer, you can consider it but usually that's not a good play, even if the offer is good the well is poisoned going forward. Certainly do not share your offer letter, specific new employer, or new salary with anyone from your current employer under any circumstances.
- If you get an alternate employment offer from other prospective employers in the meantime, you can consider them, just keep in mind there's increased risk with timing and you need to be careful you don't end up with no job. "Retracting your notice" usually doesn't work. But pulling out of a new job before you start it is just like quitting your current job for another, it's fine. (Unless you have actually signed a contract that limits notice already - not an offer letter, a contract.)
- Be pleasant to everyone at your current employer in the meantime. Give nonthreatening answers to "why you are leaving" - just say "I came across a good opportunity" or "I think it'll build my career" or whatever. See Should I tell colleagues I'm leaving and Do I have to tell my colleagues that I'm leaving?.
- Attend and give light feedback in your exit interview, but don’t burn bridges by getting too stroppy, they are not going to change anything based on your feedback. See How much should I say in an exit interview?. Do not sign any new legal agreements after you give notice unless they pay you separation $ to justify it and you're comfortable with what it says (lawyer review as necessary).
- Leave, showing appreciation and saying goodbye to close coworkers. Don't do anything unethical (take customer lists, steal code or stuff).
- Start your new job, ideally after a brief break. Until your first day, it’s OK to consider and accept better offers that come in late - it’ll make the company sad but doesn’t cross the line to unprofessional (or unusual). Once you've started the new job, however, it is considered unprofessional to take it and will generate hard feelings up to about a year. See I have 2 job offers A & B. A starts soon and B starts in summer. Is it ok to accept A, starting working and quit before B start date?
Don’t overthink it. This is the professional process adhered to by thousands of people a week. You do not need to give extra notice, see Is it naive to tell my current employer that I'll be leaving, months in advance?. You should do a professional job of documenting and cross-training at all times, and it doesn’t hurt to be extra scrupulous about it while you’re gearing up to leave, but not unusually out of your job responsibilities. See How can I prepare for getting hit by a bus?. Responsibility for business continuity is on the company, not you (except in special circumstances, like if you are a significant shareholder in a very small organization and it might tank your shares). See A coworker beat me to resignation. How can I resign in a professional manner? and Is it acceptable to quit in the middle of a project, when I am the only team member?.
Other specifics of what's going on don't affect this much - the importance of the project you're on, where you are in your career - this is the accepted way in all white collar jobs with exceptions only as weird contracts, local laws, or truly exceptional circumstances dictate. As a hiring manager, I expect all of this and while I might advocate for longer notice or whatnot in my role as an extractor of value from employees, I wouldn't take offense at it and would consider anyone who did to be acting unprofessionally. Deviating from it in most cases would be considered unprofessional. You can't control the fact that some people will freak about you quitting, but that's a them problem not a you problem. See How do I deal with my current employer not respecting my decision to leave?.