74HC4051 Multiplexing

Goal: to just light up a bunch of LEDs using push buttons. I have 8 push buttons and 8 leds. (I'm using the 74HC595 to drive the leds) So if I push PB1, I'd only like the first LED to light up and the other 7 off. If i push PB2, only LED2 is on, rest is off..etc.

So I'm using the 74HC4051 to help me control my inputs (multiplexing). I just have some questions about the chip and how to approach the code.

Pin 3 on the 4051 (Z common output or input),, what do I have to use that for? I was reading other articles and they say to put it on A0 on the Arduino. But then I don't know how to utilize it in my code. I'd like to use IF statements, just a fyi

I understand that if s0 = HIGH, s1 = LOW, s2 = LOW, it will activate Y1 on my push button. so how do i like write that in my code?

should i be making like different functions? or idk?

Thanks!