This is the standard cast-off for lace shawls and it works very well for the top of socks.
K2, *transfer these 2 stitches back to the LH needle and K2tog tbl then K1. Repeat from * .
This can easily be adapted to cast-off after any sort of rib.
Work 2 stitches in pattern, *make sure the yarn is at the back, transfer 2 stitches back to the LH needle, K2tog tbl, work one stitch in pattern. Repeat from *.