Pull-up resistor
A resistor to the supply rail that gives an input a defined state when nothing else is driving it.
A digital input connected to nothing floats: it picks up interference and reads one or zero at random. A pull-up resistor, typically 4.7–10 kΩ, gently tugs it towards high. A button or an output shorting the line to ground easily overpowers the resistor. The mirror image, tied to ground, is a pull-down.
Choosing the value is a trade-off. A low resistance gives fast edges but burns current whenever the line is held low, which shows up in battery-powered designs. A high one saves power but makes edges sluggish and the line prone to noise. Most microcontrollers have weak internal pull-ups of 20–50 kΩ, enabled with a register bit. I²C doesn't work at all without them, because the bus is built on open-drain outputs.