Salvaging Old Trim
If you're planning to reuse that molding, use this trick to remove the old nails neatly
After removing moldings and other woodwork you plan to reuse or refinish, never hammer the old nails through from the back side — the sunken nailheads will splinter the molding face. Instead, lay the molding facedown and yank out the nails from the back.
Grasp the nail up close to the wood with a pair of locking pliers or end nippers, then roll the tool over to pull out the nail. (Place a shim under the tool for extra leverage.) Fill the resulting hole on the molding face with wood putty or reuse it when nailing the molding back into place later.