Measure the distance of the space where you are planning to apply the trim. If the stringer is underneath the tread, with the edge of the tread overhanging it, the trim should be installed underneath the edge of the tread, so that it hides the joint between the tread and the top edge of the stringer.
Cut a piece of trim to the length that you measured in Step 1.
Drill small pilot holes through the piece of trim. The pilot holes should be the same diameter as your finishing nails, so that the nails fit tightly into the holes. Pilot holes will prevent the trim from splitting when you put the nails through it.
Spread a small bead of glue on the two inside faces of the trim that will be contacting the stringer and the underside of the tread overhang. Put the piece of trim in place and nail it on with finishing nails. Countersink the heads of the nails using a nail set. Fill in the nail holes with wood filler that matches the color of the trim.
Repeat this process for each stair tread to create a complete trimmed staircase stringer.