To replace worn-out elastic on pyjama bottoms with a drawstring or cord, cut it 24in/610mm longer than the casing and knot both ends; brush clear nail polish or epoxy resin on the tips to prevent fraying. Pin one end to an open seam and feed the other through the casing. Then trim.
To replace a waistband that has lost its stretch, snip open a seam across the casing and pull out the old elastic. Cut a piece of new elastic 1 in/25 mm smaller than your waistline. (Use nonroll elastic with vertical ribs to prevent twisting.) Pin one end at the open seam and work the other through the casing with a safety pin. Smooth out the elastic; then overlap the ends by ½in/13mm, sew them firmly together, and stitch up the seam.