How to access a gameobject from script?(C#)

I want to make a variable of a gameObject of a scene and access to all his properties and change it.

I want to activate and deactivate a SpotLight, change color, angle, etc, for example, from a script.

Sorry for ask this but is a little confusing and hard to searching it in Scripting Reference.

What’s hard about

  1. Visit the scripting reference
  2. Click runtime classes in the menu bar on the left
  3. In your browser do a search for “light”
  4. Follow the link to get to Unity - Scripting API: Light
  5. Click on “2” to get a small code example that shows how you can change the light colour.
  6. Ditto “spotAngle”.
  7. Scroll down the Light page a little to see the enabled property, which turns the light on and off.