There are many explanations of pull-up or pull-down resistors that gloss a bit too much over the details, keeping you in doubt about how they really work, especially in conjunction with microcontrollers.
To improve our understanding, we will use a simplified schematic that models a microcontroller input-pin connected to a switch and a pull-up resistor. Then we calculate the voltages on the input-pin resulting from a closed or open switch.