Sort:  

In nutshell you connect secondary side of optocoupler to gate of the relay, then you use first side of the optocoupler to drive secondary side. (which is now connected to gate of relay)