I can't access the static variable in arrays.

Script:1
public class Test : MonoBehaviour
{
public List list;

public void value()
    {
        list[0].Test2.number+=100;
    }
}

Script:2

public class Test2: MonoBehaviour
{
    public static int number;
void Update()
    {
        if(number > 0)
        {
            Debug.Log(number);
        }
        
    }
}

I created a list, I want to access the zeroth element, I cannot access it. How do I access it with code.

EDIT: This is wrong, sorry. The correct solution is in my comment below.

To access classes/scripts of gameObjects, you need to use GetComponent first. So you would want to instead use
list[0].GetComponent<Test2>().number += 100;

Hope this helps!

list[0].GetComponent().number += 100;
I tried that method but it didn’t work