Can't key(button) in an "if (Array[index])"

In an if statement or any loop I can’t put in an “array[index]” without the responses erasing ‘array’ with a and visa versa. am I not pressing the buttons in the right order? this always comes up and when I need it again I struggle.