Beginner needs help reading a pattern

I am in the process of knitting a pull-on hat. This is my first knitting project and I need some help reading my pattern. I have knitted three and 1/2 inches of a 2 x 2 rib. K2, p2. I am getting confused on the next row. My pattern shows three sizes and I am knitting the third size. These are the directions. Could someone walk me through please?

P2 [3:2], p2tog, (p6 [5:4], p2 tog) 5 [6:8] times, p2 [3:2]. 40 [43:45] sts.

I am thinking that I
purl 2
purl 2 together
purl 4, purl 2 together (8 times)
purl 2
not sure what 40 [43:45] sts means (?)

Thank you for any guidance you can give.

The numbers between the brackets are for different sizes. So you’ve got it! Was that all one row? If so the numbers at the end are how many stitches you’ll have for your size at the end of that row.

THANK You for such a quick reply! Super. Yes, it was all in one row. Now, I understand.
Thanks for your help.

You’re welcome! Welcome to Knitting Help!