There are two ways to edge a project -- either knit a different stitch around the edges (i.e. for a scarf: 3 rows of garter stitch at the beginning, then 3 stitches of garter at the beginning and end of each row, 3 rows of garter at the end) or, after you're finished, pick up stitches around the edge of the piece and either knit or crochet a border to keep it from rolling.
Knitter's Geek Code
KCR+ Exp+ SPM+ Steel+ Bam+ Addi++ Pl-- Wool++ Cot Lux+ Stash Scale+ Fin !Ent Int FI> Tex Lace Felt Flat Circ+ Dpn- ML+ Swatch+ KIP+ Blog+ SNB> EZ? FO+ WIP3 Gauge W+ Alt Sw