Resigning can be difficult. Here are the things you need to do in order to resign and leave a lasting positive impression on your manager. Be sure to offer enough notice before you leave. Two weeks is generally sufficient time to hire and train a replacement.
You might want to write to your coworkers as well as your manager, but make sure your manager knows you are resigning before you tell your coworkers. You can write more casual letters or notes to your coworkers to let them know. Write to each one individually and offer your contact information.