You use Kirchoff's laws which state that the current flowing into a node equals the current flowing out, and voltages round a closed loop must sum to zero. Put more simply, V1 + V(R1) + V(D1) = 0. And I(V1) = I(R1) = I(D1).
You can then determine the voltage and current through the resistor. The data sheet for the LTL-307EE states a forward current of 20mA at 2V forward bias, its recommended operating point.
So using the 1st law, V(R1) + 2 - 5 = 0 (Note the signs: current traditionally flows from + to -, and in a diode in the direction of the arrow). So V(R1) = 3V.
Using the second law, the current flowing through the resistor equals the current through the diode, 20mA.
So by Ohms law, V(R1) =I * R1 i.e. R1=3/0.02 = 150ohms.