Border help for button whole

Needing help with the last part of my right front border for a baby cardigan (Sirdar 4779 pattern)

Managed to pick up 23 sticthes ok and completed the first row for the pattern of 1x1 rib but stuck on the next part:

Rib 3, cast off 1 st (rib 4, cast of 1 st) 4 times, rib 2.

Rib 3 = p / k / p, do I then knit a stitch then cast if off or do I cast of the 3rd stitch of rib 3? Also when I move onto rib 4 part do I start by purl or knit?

Many thanks

Rib 3 (pkp)then knit 2 more (kp) and lift the first of the two over the second. That’ll leave one stitch on the right hand needle. Count that stitch as part of the following rib 4.
Continue with a knit stitch.