Flashlight toggle with left mouse click script

Hello. I’m trying to make a flashlight script so that when I click the left mouse button is turns the spotlight on and off. I’m new to Unity so if anyone has advice thanks!

This have been asked many times, please, try at least google searching before asking.