You could use the sandwich method where you give the boss a compliment, explain why you're leaving, and then finish with another compliment. This way, your boss will have a few positive notes wrapped around the resignation and they'll be less likely to get mad at you for quitting.