There are many different ways to knit a rib stitch. There is however usually only one reason to kit a rib stitch and that's to give your fabric extra stretch. Usually reserved for items that need fitting and stretch like the bottoms of sweaters and sleeves, the tops of socks. Sometimes, an entire garment is knit in rib stitch.
Now if you're knitting an entire garment in rib stitch you might not want a boring 2X2 rib stitch. That's where fancy rib stitches come in to play. Plain rib stitches are great for things like sock tops and sweater hems and are usually just a knit/purl combo. The most common are 1X1 (K1, P1) and 2X2 (K2, P2). Keep in mind the larger these numbers get the less stretch you have. The reason that ribbed knitting is stretchy is because of the extra yarn where you switch between knitting and purling. The fewer switches you have the less stretch you have.
There are rib stitches where you alternate ribs of stockinette and garter stitch. There are broken rib stitches where you intentionally don't line up your ribs. There are rib stitches where you intentionally drop stitches, twist stitches, slip stitches, knit/purl stitches together. The possibilities are endless. I'm knitting a ribbed bag right now where the ribs are YO, K2 Tog. Not what most would think of as a rib pattern but there are ribs of holes and ribs of stockinette.
If you're not adventurous enough to make up your own rib pattern you can search for "knit rib stitch pattern" on any search engine and find 100's of different stitches, or try one of these.
Rib Pattern 1 (Garter Stitch Rib)
R1) K2, P2
Repeat these two rows and you'll have a garter stitch/stockinette stitch rib if done over a multiple of 4
Rib Pattern 2 (Lace Rib)
R2) YO, K2Tog
This will give you a lace rib. If done over an even number of stitches
Rib Pattern 3 (Broken Rib)
R1) K2, P2 (end with a K1 or a P1)
R2) Knit the knits and purl the purls
This will give you a rib pattern where the ribs don't line up from row to row if done over an odd number of stitches.
Rib Pattern 4 (Twin Rib)
R1) K3, P3
R2, K1, P1
This will give you ribs within your ribs when done over a multiple of 6 stitches.
Rib Pattern 5 (Diagonal Rib)
R1) K2, P2
R2) K2. P2
R3) k1, *p2, k2; rep from *, end p2, k1
R4) p1, *k2, p2; rep from *, end k2, p1
R5) *p2, k2; rep from *
R6) Rep Row 5
R7) Rep Row 4
R8) Rep Row 3
Those are just five examples of what you can do with rib stitches. Implement them in your knitting and you'll find you've opened whole new worlds of possibilities.