I've decided to resign my position as <position> at <company>.
My last day of work will be <2 weeks from today>.
Sincerely, <name>"
During the exit interview your reason for leaving is "decided it was time to leave to pursue other opportunities."
Public leaving letter you send out to coworkers: "Hi guys, it's been awesome working with you. I've met some truly exceptional people and you all have lots to be proud of.
I've decided to move on and pursue other things, but I truly wish everybody here the best and continued success and good luck!
Feel free to reach out to me at <personal email address>"
Your employers aren't stupid and people leaving right after they decided to do this will be an obvious cause and effect. Bonus, if they're contacted later on by a future employer for a reference, your outgoing personnel file won't be filled with bridge burning that could harm you later.
Everybody gets dissatisfied with their job at some point and leaves, it's part of being a working professional. Learning how to do it in a professional way is an important skill to develop.