If necessary, remove the old trim from the door.
Caulking applied to the seam between the door trim and the sheetrock can tear the paper on the sheetrock when prying the trim off. If there is such caulking, it's wise to slide a sharp utility knife along the seam to make a clean cut through the caulk down the full length of the trim before prying.
With a hammer or pry bar, gently but firmly pry the old trim off the wall.
For best results, place a shim between the hammer and the wall to minimize damage.
Start from the corner, and work along the length of the trim.
It is not uncommon for some nails to remain stuck in the frame after the trim is removed. Use a hammer or pliers to remove them.
Measure the door frame.
Measure along the inside of the door frame, from floor to corner.
Make sure to record the measurement for future reference.
Measure each section of the door (the top, and both sides) in the same way.
It may be useful to have a friend or roommate hold the measuring tape at the bottom so it doesn't move.
Prepare to cut the new trim to fit the door.
Using the measurement from the previous step, mark the appropriate length on the trim to be installed.
This will mark where the trim lines up against the inside corner of the door.
Align the chop saw to make a 45 degree cut.
Consult the user's manual as needed to set up the saw correctly.
Align the trim on the saw so the mark you made is along the guide of the saw.
Again, the user's manual will provide specifics of how this is accomplished.
Operate the saw in a safe manner in accordance with the user's manual.
If you are uncomfortable using power tools, your local hardware store may cut the trim for you, using the measurements you made earlier.
Align the new trim along the edge of the door. It should be lined up with the door frame.
The trim is aligned correctly when the frame is covered completely by the trim.
Use a level to ensure it is vertical.
Have another person hold the new trim in place after it is aligned, if necessary.
Using trim nails, nail the trim to the wall, starting from the top.
Align each nail so it is perpendicular to the surface, and hammer it in with smooth, forceful strikes.
Nail along the inner edge as well as the outer edge.
The nails should be place 18 to 24 inches apart along each respective edge.
Door trim is fragile, so avoid striking the trim directly with the hammer.
A small dab of joint compound or spackling will hide the nail holes.
Place a small amount of spackling (about the size of a BB) on the tip of a finger.
Press the spackling into the nail hole.
Wipe across the top of the filled hole with a putty knife or any flat blade to remove excess spackling.
Use matching paint to cover the filled nail holes and touch up any nicks.
Be mindful of wet paint when using the door!