Iron the PJ trousers from the bottom up, about 18-20 inches up the legs.
Measure the desired length of your bag, add about ¾ of an inch and cut - I measured against another bag I use, and found that about 15" makes a great length for shoes to go in a suitcase.
You could just pin and sew across this newly cut open seam as is, but I chose to fold it down a slim margin - ⅜ of an inch, and pin
Sew along the pinned seam to close up your new bag. I did a zig zag stitch, mostly because I had just done a cleaning and maintenance on my machine and I wanted to make sure everything was running well, but it is my go-to for a lot of projects, it has a little stretch to it, and I think it's generally a good choice, here I think it will combat fraying damage and along with the fold, give the bag a sturdier bottom seam. A standard, straightline, running stitch would work fine.
Working on the open edge - find the vertical seams in the cuffs. There should be two - the inner seam and... well, the outer one... Using a seam riper or fine scissors, open these up only working below the hem, so that you don't split your bag, the point here is just to open the tube created by the cuffs. Depending on how the PJs were sewn, you may find that once you rip through the outer most seams, there's a second seam inside to get through.