To replace an exterior door, first remove the interior and exterior casing to expose the door frame and the rough opening. Proceed carefully, minimizing damage to the siding and finish surfaces whenever possible. Exposing the rough opening enables you to measure it exactly and inspect for water damage or rot, which must be repaired before installing a new unit.
To remove casing without breaking it, use a flat bar to raise it slightly; then use a reciprocating saw with a metal-cutting blade to cut through the casing nails.
(Wear safety glasses.) Cutting nails is far easier on surrounding surfaces than prying alone. However, some casing can’t be removed without destroying it—stucco molding, for example.
In many older houses, the sill will be a 2-in.-thick board notched into the framing so that it sits flush with the subfloor. If it is in decent shape, leave it. If it has rot, cut out the sill and install a floor pan over the framing before installing a replacement sill that’s flush to the subfloor. If there’s a sloping threshold atop the sill, remove it.
It will probably be weathered, and anyway, the new preframed door must sit on a level surface. (New exterior doors typically have a combo sill-threshold preattached to the side jambs.)
To install the new door unit, remove the existing door frame, preferably by cutting through the nails holding it to the rough opening so that you can pull out the frame in one piece. That way, should the new frame not fit, you can easily replace the old frame and rehang the door so you won’t be without a door while you correct the problem.