First - be sure you are ready to leave. This means get everything ready before you inform people. Pay stubs, documents that you need to save etc.
Second - write your two emails and keep them in draft. One about informing on leaving and why. Keep it positive and neutral language, do not be nasty or arrogant. Other asking about handing over stuff, knowledge transfer etc. to your manager.
Third - talk to your manager privately. In a conf room, inform in person. Be ready to say no to counter offers. Or any other last minute temptations. Don't take anything verbally promised to you. Be nice, be cordial; leaving a job is routine, keep drama out of it.
Once informed and manager accepted, send those two emails to them. Proceed on next steps of handing over stuff you're working on, any knowledge transfer during notice period. Be genuinely good in helping them ramp your replacement.
Do not be nasty or slacking. Be professional. Keep things on good terms. World is a small place, how you behave matters. You will need recommendations. You will need managers to answer any background checks positively. You might even have to work with them again in future. Do not burn bridges. Do not tell anyone where you are going or how much more you will be earning.
Ensure you collect your last paycheck, any other dues and experience certificate/letters.