How do I turn on a magnetic lock with an Arduino?
You need a relay circuit, here is a simple relay circuit example.

 (source)

You should find a relay with 5VDC coil, and replace the +12VDC power supply with 5VDC, use the same power supply that powers your arduino. And then use 12VDC power supply instead of 240VAC. Put you magnetic lock where the 240VAC bulb is.