Phototaxis is the scientific term for how an organism’s body reacts to light. Positive phototaxis means that an animal is attracted to light, and negative phototaxis makes an animal move away from light. Nocturnal insects, like cockroaches and earthworms, have a negative phototaxis.
Many flying insects are the exact opposite: they have a positive phototaxis. It’s a natural instinct for them to move towards the light and hover around it.