There is no federal statute on the subject. Trusts are governed by State law, and many States have enacted a version of the Uniform Trust Code (UTC), drafted by the Uniform Law Commission. Under the UTC model, a trustee may resign upon at least 30 days' notice to the qualified beneficiaries, the settlor if living and all cotrustees, or with the approval of the court. The official text of Florida's trustee resignation statute, section 736.0705 of the Florida Trust Code, makes both routes available whatever the trust instrument says, and adds a first route: resignation under the procedure set in the trust instrument. Other UTC States are less generous: Arizona, in section 14-10705, applies the 30-day route only if the trust instrument does not provide otherwise.
Two companion rules matter as much as the resignation itself. Section 736.0705(3) says the resignation does not discharge any liability for the trustee's past acts or omissions, and no letter can turn a resignation into a release. Section 736.0707 then keeps the duties of a trustee alive until the trust property is delivered to the cotrustee, successor or other person entitled to it, and requires that delivery within a reasonable time, with the right to keep a reasonable reserve for debts, expenses and taxes.
Not every State follows that pattern. Texas never adopted the 30-day route: under Texas Property Code section 113.081, a trustee resigns as the trust instrument provides or by petitioning a court for permission, and section 113.083 has the successor chosen by the method in the instrument or, failing that, by the court. Florida adds, in section 736.0813, that the trustee of an irrevocable trust owes each qualified beneficiary a trust accounting on a change of trustee.