Can I change the voltage (12V) input into my optocoupler to 24 V?
Loosely:

Measure(or look up, or guess) the coupler input current, using the original 12V supply voltage (example: 20mA)
At 24V there is an extra 12V to get rid of.
To do this at the measured current (again say it's 20mA) takes an extra resistor of R = U/I = 12V/20mA = 600 ohm