I want to share with you this very important (for many reasons) technique that makes your knitting edges perfect.
Let's look at these pictures first.
This one shows two swatches worked in Garter Stitch (knit all sts).
Can you see how different the edges are? The left swatch does not have the selvage stitch. The right one does.
Here is another view of the same swatches.
The right side has a very even edge which makes a good finish. It is as important for a scarf as for a detail of a sweater. When you need to sew pieces together, it is so much nicer to work with these straight edges, not knots. Having said this, I want to mention that sometimes the left side is a choice in the pattern if it complements the whole look of a project.
There are a few ways how to obtain this straight edge. I make it simple for myself.
Here is what I do. If the pattern does not include selvage stitches, I add 2 sts to the stitch count.
I ALWAYS slip the first st purlwise with yarn in front like in this picture:
The stitch will be on your right needle.
Work the rest of sts in pattern to the last one. This time you will knit all sts, but it could be a very complicated pattern instead.
ALWAYS knit the last stitch through the back loop like this.
Repeat every row: Slip the first st with yarn in front and knit the last st tbl (through back loop). The result is the nice edge you see in the first two photos.