For this fix, you will need a needle and some strong thread (top stitching thread is ideal)
Slide the slider up, and the zip should close, if it doesn't there is probably something wrong with the slider where it has warped out of shape or there is a kink in the zip.
|Sew a large stopper that will stop the slider|
|Sew under and over the bottom of the zip|
Now you need to make a stopper for the zip so that it won't slide off. This is where the needle and thread comes in. Make a thick stopper by sewing under and over the zip a number of times. Sew the ends of the zip back in to where they should be and replace any stitches that were undone in the process.
Trouser zips can be tackled in the same way