When you get to the end of your piece of weaving, you have a few options for how you “finish” the non-selvedge edges. One of the commonest ways is to use hemstitch. This gives you a neat, regular stitch that holds your weft in place and creates little groups of warp threads that are perfect as a fringe or for creating tassels.
This is the best set of pictorial instructions I’ve seen, so go check them out if you’re not familiar with how to do hemstitch. I particularly like that you get to see the back of the hemstitching as well as the front. It’s one of the traps for new stitchers that a lot of these type of edge stitches are only ever shown on their prettiest side.
Mastering hemstitch is worthwhile, because it gives such a neat edge and one very useful for scarfs and shawls, but you can also do a simple overcast/whip stitch if you’re after a simpler stitch (it can look nice as a feature).