How to make a game object light up only when its clicked on

Hi guys, so basically I got 4 game objects and i want them to light up only when they are clicked on. How do i do this please help.

You can use OnMouseDown for clicks. Not sure what you mean by “light up”

void OnMouseDown() {
    GetComponent<Renderer>().material.color = Color.green;
}

You need to create a light component then use OnMouseDown to detect a click then use that to change if the light is enabled or not.

private Light light;

void Awake()
{
light = GetComponent();
}

void OnMouseDown()
{
light.enabled = !light.enabled;
}