Trying to understand pull-up resistors

Think of it this way -

A transistor is just a switch. A silicon switch instead of a mechanical switch, but a switch all the same.

When the switch is turned on the input and output are connected together and it the input is conected to +V the output will be at +V also. If the input is connected to Ground then the output will be at ground also.

Now = turn the switch off. What state is the output? Don't Know, it is FLOATING. So we add a pullup or pull down resistor so when it is not active we are making our input go to a known state.

So - if our switch is connected to ground (low side switching, common for simple transistor switches) we use a pull-up resistor so when the switch is open the input to our device is at +V. If our switch input is at +V then our resistor will be tied to ground for a pull down resistor.

The resistor is there so when our input device is in its inactive , or off state, our input will be at known state. Things just work more rliably that way.