1.8v GPIO controlling 5v 10mA solid state relay
Basic transistor laws for a BJT.

Collector Current = Base Current * beta


beta is the "amplification factor" for the transistor you can get from its datasheet.

You're going to put a resistor in series with your base current. Think of the base to emitter as a diode that gives you a 0.7V drop (check the datasheet if you want a more exact/specific value for your transistor). You are applying a voltage (V_pin) to that resistor to allow a current to flow. The voltage drop that resistor will see across it is effectively (V_pin - 0.7) assuming your transistor's emitter is connected to ground with respect to V_pin. And if you have a base resistor of size R_base, by extension you will have a base current of (V_pin - 0.7) / R_base.

So you know you can get a certain current (I_collector) to flow through your collector emitter junction by choosing R_base by the following formula:

R_base = beta * (V_pin - 0.7) / I_collector


So now you want a certain voltage out. Lets say you have V_high volts to source from. Well you know you can generate a desired current by the formula above by picking R_base. Now all you have to do is pick a resistor in series with your V_high that will give you your desired voltage drop at I_desired - using plain old Ohms Law V = I * R. 

R_collector = (V_high - V_out_desired) / I_collector


To recap: 


Pick a transistor (this gives you beta and some maximum limitations)
Pick a smallish base resistor (this determines I_collector)
R_collector is determined by R_base, V_high, and V_out_desired.


My circuit would look like this: