how can I find out which resistor is definetely the right one for my setup?
You need to know the part number of the opto isolator you have.
Then you look at the datasheet and find the recommended operating current of the LED, call this I. Then you need to find the forward voltage drop of the LED call it Vdrop.
Then calculate the voltage drop across the resistor which is 5V - Vdrop, call this V.
Then the resistor will be given by V/I