Rehabilitating leg warmers
This stuff is not expensive.  Simply unpick the stitching, and replace it.

The hardest thing will be doing the stitching in a way that will stretch, because a plain straight stitch will not work.  A fancy modern sewing machine can do these stitches, as can an overlocker.

Example pricing seems to range from a few dolleurosuid to tens of them.  It gets cheaper in larger lengths, with 50 metres being under $1 / metre.

https://www.aliexpress.com/w/wholesale-silicone-gripper-elastic.html  for example.  Keywords here are "silicon grip elastic"