A pull-up resistor is used to ensure that a digital input pin is at a known high voltage level (usually Vcc) when no other devices are driving the pin. This prevents the pin from floating and picking up random noise, which could lead to unpredictable behavior. Are you working on a specific circuit where you need to use a pull-up resistor?