Iam kind of new to knitting and I found a scarf pattern I wanted to try but I don’t think I’m understanding it right. Here is what it says:

Cast on 62 stitches
Ripple Stitch: (multiple of 18 sts)
Row 1: (RS) K4 *[K2tog]3 times, [k1, yo] 6 times, [k2tog] 3 times; rep bet *s; end K4
The next rows have me k4,p54,k4

So my problem is-if you knit the stuff between the *'s, doesn’t that leave you with more than 18? From what I understand, you’re supposed to K4 and do 3 sets of 18 and then K4.
K2tog 3 times leaves you w/ 3 on your needle
k1 6 times = 6 left on your needle
yo 6 times = 12 left on your needle
k2tog 3 times = 3 on your needle
3+6+12+3=24
Where am I messing up?

almost. you just added up wrong.
the k2tog s times = 3
k1 6 times = 6
[COLOR=Red]yo 6 times = 6[/COLOR]
k2tog 3 times = 3
3+6+[COLOR=Red]6[/COLOR]+3=[COLOR=Red]18[/COLOR]

the YO is adding just one stitch not 2.

The YOs add a stitch but the K2togs dec a stitch, so the stitch count stays even. In each pattern repeat, you dec 6 times and inc 6 times. The YO is just wrapping the stitch around the needle, you don’t use a stitch to make it.