You have decided to resign from your work in order to try a new field. write a letter of resignation to your boss, in your letter.
Tell your boss of your decision and explain why you are leaving.
Explained what you have learned from your current job and how you feel about leaving.
As for a letter of refference.