Can't figure out how to use pwm with an optocoupler and a MOSFET

Not really, in the diagram it didn't specify that. What would you recommend me to check out if I'm connecting wrong the circuit?