I'm assuming you're knitting flat? Like a scarf? Not sure exactly what you're doing, but I suspect you're knitting the knits and purling the purls.
To get ribbing you knit the knits and purl the purls. What this means is you must know what you're stitches look like. This an important thing to know in all knitting. All stitches have two sides. A stitch you knit will be a purl on the other side, etc.
Here's a swatch.. You can see the purls look like bump snugged up and the knits look like V. When you turn your work you'll see the other side.
For a k2, p2 pattern it would look like this -
1. kk, pp, kk, pp,
2. pp, kk, pp, kk
3. kk, pp, kk, pp