Is there any way to make a script that can turn lights on when I'm looking at it?

So, in my game I encountered a weird problem, I noticed that some lights turned on only when I looked directly at them.
I figured that the problem must lie in the fact that it was too much to have 8 point lights and a spot light.
So I began to wonder, is there a way to make lights turn on and off depending when you are looking at it?

Thanks in advance!

Yep!

Maybe try Unity - Scripting API: MonoBehaviour.OnBecameVisible(), but be warned that it needs a renderer (lights don’t typically have a renderer).