Why wont this little light turn off

Hello!

I'm just trying to get a LED to turn on when the soil moisture sensor says that it is dry. That's all.

I know my wiring is correct, because if I tell the LED to turn to HIGH when the soil sensor is HIGH, then it doesn't turn off. Any help is greatly appreciated.

Here is my code

int led = 12;
int moistureSensor = A0;


void setup() {
 
   
  Serial.begin(9600);
  
  pinMode(led, OUTPUT);
  pinMode(moistureSensor, INPUT);
  
}


void loop()
{
   int sensorValue = analogRead(moistureSensor);
    
     if (sensorValue, HIGH)
     {
        digitalWrite(led, LOW);
     }
     else if (sensorValue, LOW)
     {
        digitalWrite(led, HIGH);
      }
  delay(1000);
  }

if (sensorValue, HIGH)
Change to
if (sensorValue == HIGH)

else if (sensorValue, LOW)
Change to
else

You don't need to set the pinMode for a pin that is used as an analog pin.

Further you use analogRead(); the result will be a value between 0 and 1023 (both included).

I assume your code wants to compare and if so, you are comparing it to HIGH (value 1) and LOW (value 0).

The chances that the value is 0 or 1 is actually quite small.

I don't know about moisture sensors, but the below can be an approach

if(sensorValue > 500)
{
  // wet
}
else
{
  // dry
}

You can finetune the limit.