Measure the stairway opening where the trim will be applied. If necessary, use a ladder to reach the opening. Be very careful when doing this, as this may involve mounting a ladder on the stairway itself. In many cases, however, you will be able to reach the opening without a problem.
Add the width of your wood trim to any piece that meets another piece once, and add twice the width of the wood trim to any piece that meets another piece twice.
Cut with a saw pieces of molding to measurements you found in step 2.
Bevel the edges of the molding to 45 degrees as needed using a miter saw.
Apply a thin layer of adhesive caulk to the flat back of the molding.
Press each piece of molding to the appropriate edge of the staircase opening, fitting the edges together like a picture frame.