Easier than adding an external resistor is to use the INPUT_PULLUP mode of pinMode() to activate the built in pullup resistor and wiring the switch to take the pin to GND when it is closed. The downside is that you have to change the program logic to use match the hardware setup but it can make for a neater circuit with no extra components involved.