Typically a data sheet will tell you the maximum and minimum voltage a part can handle or requires.
You can use that information and the voltage for the circuit you are building to determine an appropriate resistor value.
It can be more complicated.
Perhaps with additional information such as the part in question, the circuit in question, the voltage source, etc. a better answer could be constructed.