Technically, tying a lining to a pair of shorts or pants may be a bit complicated, but it is actually not difficult and very easy.
Production tutorial
1. Unzip the shorts or skirt and lay it flat.

2. Align the lining with the waistline, cut a notch along the waistline, and fix it in place.

3. Sew the fabric of the shorts to the shorts along the waistline from 1.5 cm.

4. Turn the lining over and press the waist seam gap against the fabric.

5. Then sew the seam allowance to the fabric close to the seam, which prevents the facing from rolling to the outside.

6. Align the center back seam with the edge of the lining, all the way to the bottom of the zipper.

7. Sew the lining to the zipper at the center back seam.
Sew down until you touch the zipper head.

8. Now, we need to sew the rest of the center back seam

9. Pick up the unfinished center back of the lining and sew together.

10. Notch the curve seam and open.

11. Now, turn the shorts back to the front.

12. Pull both layers of lining through one of the leg openings, match them up, align the center seams, and pin in place.

13. Sew and overlock.

That's it!
From the front.

