The first step is working out how much yarn you need to leave attached to your project. Measure 4x the edge you're binding off and then cut the yarn at that point.
Thread the yarn onto a tapestry needle.
Insert the tapestry needle into the second stitch on your needle (to the left of the stitch you would've knit if you were knitting another row) as if to knit and thread the yarn all the way through that stitch.
Insert the tapestry needle into the first stitch on your needle (the stitch you would've knit if you were knitting another row) as if to purl and take that stitch off the needle, threading the yarn all the way through that stitch.
Repeat steps three and four until all stitches have been bound off.