Light Toggle

How do I toggle a spotlight? I’d like it so I use the f key to do it.

An answer like that has been asked a lot on this forum. Try using the search bar a bit more.

Input.GetKeyDown(KeyCode.F){
  gameObject.enabled = !gameObject.enabled;
  
}