Using arduino inputs more reliably

"Floating" inputs on the are undefined and they might read high or low. They are also very-high impedance which makes open/floating inputs very sensitive to electro-magnetic noise pick-up and that can make them switch randomly between high & low.

When the switch is closed, is it low or high?

If closed is low (switch wired to ground) you can simply enable the internal pull-up resistors.

Otherwise, you might have to add pull-down resistors, or reverse your connections and your software logic so you can use the internal pull-ups.

...A pull-up resistor holds the input high by default. Then when the input is grounded by closing the switch, the resistor is "overpowered", current flows through the pull-up, and the input is low.

Pull downs work the same way... The resistor is "overpowered" and current flows through the resistor when forced to the opposite state.