I want to resign but my boss treated me well. What reason should I use to resign?
If your boss has been treating you well, instead of writing a letter, I would suggest you to talk to him in person.
If this new job involves relocation, blame everything to the current city where you are;
If this new job is in the same city but has shorter commute, blame everything to the traffic;
If the new job is in different field, tell him you don't think the current career fits you and you want to try something new;
If the new job is in the same city, requires same amount of commute, in the same field, tell him they offer a better compensation or bigger responsibility. if you get counter-offered, tell him that you have made up your mind although it's been the toughest decision you have made in your whole life.
if the new job is in the same city, requires same amount of commute, in the same field, and offers same level of compensation and responsibility, AND your boss treats you well, man, i don't know why you want to move.