I've sadly been in that position as well... twice (once in a summer job situation, one in a professional role).
In my experience it's best to go in and talk to the manager directly. Tell them that you are resigning/quiting, be polite about the reasons why and tell them that you'll work with them if they need time while transitioning the role. For me in both cases I was out the door at the end of the day. While it was a tense situation (especially resigning after a week in the professional role), it was handled calmly and fairly.