Arduino Buttons

See the first part of this tutorial about how to use INPUT_PULLUP mode with a button. It shows how to wire diagonally across the button to guarantee you pick up switched legs.

https://roboticsbackend.com/arduino-input_pullup-pinmode/