Magnetic fields and their effects