It depends on how many sts you have, a multiple of 4 or a multiple of 4 plus 2  not all ribbing will conform to what your book says, though 2x2 rib is a multiple of 4 sts, but you can have 4 +2 as wekk. If it's a multiple of 4 you start the RS rows with k2 and end with purl 2. Then on the next row, you do the same. If it's a multiple of 4 plus 2, you start and end the RS rows with k2, and the WS rows with p2.
To stay in pattern no matter how many stitches you have, after the first row, you knit the sts that look like knits and purl the ones that look like purls. If you can link or name the pattern, we can look at it and help you work through it.
__________________
sue knitting heretic
