Making of a pull up resistor.

Wrapping my pea brain around the concept of a pull up resistor. I actually get it but... I googled "pull up resistor" There are so many recommendations for the standard resister size. 10k 47k and 4.7k.
All will work, but which works best?

Lets just say, I'm using it for a push button switch on my arduino with 5V, I know it has something to do with the amount of draw from the electronics it's running.

How to calculate which resistor to use to maximum efficiency/minimizing the amount dissipated?

Thanks. Nick

I use 10K for near by pull-ups. I have lots of them.
Smaller values for further away.

Why not use internal pull-ups see:
INPUT_PULLUP

The idea of a pull up resistor is that if you have lets say a button connected to a input pin and ground.
when the button is not pressed the input pin is not connected to anything and is said to be floating. Even just waving your hand near it can cause it to change from HIGH to LOW or LOW to HIGH.

To prevent this, a pull up resistor is used. connect it to the input pin and 5v. this gives it a connection to 5v thru the resistor and follows Ohms law so V/R=I so 5v/1K = 5mA . A 1k pull up resistor will consume about 5 mA(there is also the internal resistance of the arduino).
This means the input pin will always read HIGH when the button is not pushed. As long as EMI or other interference doesn't overcome the resistance.

Most arduino's have a built in pull up resistor rated between 20-50K ohm's. this is usually enough to keep the input from floating when the button is near and the wires are short. it also consumes very little current (.1-.25mA)
but it is not very strong.

When the wires are long or in a noisy environment(lots of EMI) it is often necessary to use a lower resistor value to overcome the interference. This will consume more power, but is better able to prevent false signals from occurring.

The take-away here is to use the internal pull up when possible to save power. but if you start getting false signals a lower value resistor may need to be added.

Local pullups on the board can probably be upto 50k, but for signals coming in from remote switches
down a cable I'd suggest 1k as then you have significant risk of noise pickup along the cable run.

The internal pull-ups on the chip are specified as 20--50k, adequate only for local devices