To cast off, you will usually be using the knit stitch as shown here.
Cast-off – step 1
First knit two stitches
Cast-off – step 2
Insert the left-hand needle through the first stitch you knitted on the right hand needle from left to right, keeping the left-hand needle at the front.
Cast-off – step 3
Take this stitch over the top of other stitch on the right-hand needle
Cast-off – step 4
Move the loop completely off the needle leaving one stitch on the right-hand needle.
Cast-off – step 5
You have now cast off one stitch. To cast off the next stitch you need to knit another stitch, then repeat step 2-4. Repeat until you have cast off the required number of stitches. You will still be left with one stitch on the right-hand needle. Simply cut the yarn and thread it through the middle of the last stitch before slipping that one off the needle and tightening up the yarn.