Replace the roof edge during a re-roofing after the old shingling or other roofing is removed. Take off the old edging by slipping a pry bar under it and lifting up to pull out the nails holding it to the roof decking. Inspect the decking for rot or damage, and repair any damage before placing the new edge.
Remove the roof edge without taking off the shingles. Lift the shingles as high as possible without breaking them, slip the pry bar under the nails and pop them out. Pull the old edging out after the nails are pulled. Check for any underlying damage; fixing that may require removing some shingles. Slip strips of new waterproof underlayment under the shingles if the old material has deteriorated.
Install new roof edge at the bottom or eave first. Slide it under the waterproof underlayment. Fasten it with beads of roofing cement on the top and bottom of the edge that goes under the shingle if you cannot lift them high enough to drive nails with a hammer. Use a T or P style edge on an eave with a gutter; these have long lips that overhang the edge of the roof to direct water into a gutter, then bend back toward the side that goes down the facing board.
Put rake edge over the waterproof underlayment to prevent the wind from lifting the material and allowing water underneath. Use basic 90-degree edging on rakes, with the bend at the edge of the roof decking. Nail the top part to the roof decking if you can lift the shingles; otherwise, seal it with roofing cement on both sides of the edging to fasten it to the roof and the shingles to the edge.
Overlap edging at any corners. Let the rake edge come down past the eave the width of the flashing. Use tin snips to cut a slot at the 90-degree bend in the flashing. Bend the side of the edging around the corner, then bend the top down over that and drive a nail through both pieces to hold them. Overlap edging at gable peaks by running one piece to the peak and fitting the adjoining piece over it.