First Steps

how the board know that pins1 should be button 1? thats what i dont understand

You connect the switch to some pin. Then, you tell the program that the pin is an input pin, using the pinMode() function, and you read the state of that pin, using the digitalRead() function. Both of these functions have, as the first argument, the pin number.

That is how the board knows which pin goes with which switch or which LED. You tell it.