ribbing: 1×1 and 2×2
to purl after a knit, bring the yarn forward between the needle tips. over the top makes an extra stitch.
after the first row you read the fabric, not the pattern: a vee facing you gets knit, a bump gets purled.
ribbing is knits and purls in the same row, and it stretches, which is why it lives on cuffs, hems and hat brims.
the one rule
before every purl the yarn goes to the front, between the needles. before every knit it goes to the back, between the needles. if it goes over the needle instead, you have just made an extra stitch. that is the entire difficulty of ribbing.
1×1 and 2×2
"k1, p1" across a row, then the same on the way back, lines up the knits over the knits. that is 1×1 rib. "k2, p2" is 2×2, stretchier and squishier. a pattern writes it as **\*k2, p2; rep from \* to end** and needs a stitch count that divides by four, which is why the machine rounds your cast-on.
reading the row
after the first row you do not need to count. look at the stitch on the left needle: a vee means knit it, a bump under the needle means purl it. knit the knits, purl the purls. every ribbed thing you ever make works like this.
the tell
sixteen stitches at the end of every row. if the columns are not lining up, a knit fell on a purl somewhere; look for the row where the vees jump sideways.