If a resignation is abrupt or inconvenient to the company, this apologetic resignation letter can smooth things over.
Dear Mr./Ms. Bossname
It is with great regret that I announce my resignation, effective (date). I will be leaving the company due to (reason).
I am sorry for the short notice, and for any inconvenience this causes you in finding a suitable replacement. It was not my intent to cause difficulties, but the situation requires my departure. Thank you for your patience, and please let me know if there's anything I can do to make the transition go smoothly.