4N35 Optocoupler confusion

Thanks everyone for this detailed and useful advice. I'm not certain whether it's running AC or not, as my multimeter only measures DC currents, but the current does seem to fluctuate, which might be part of the reason the optocoupler isn't doing the trick. The advice to use a relay instead has been duly noted!

Just so I can get my head around it for the future, for what sorts of real-world applications should you choose an optocoupler instead of a relay?