DHT11 not working with LED in arduino
Your code does not work because in fact error statement reads the value of temperature and humidity sensor.
You set the humidity and temperature variables to 0. If statement compares this variables to 70, before actually reading sensor data.
I haven't tested but this should work.
#include &lt;SimpleDHT.h&gt;

int pinDHT11 = 2;
SimpleDHT11 dht11;

void setup()
{
    Serial.begin(9600);
    pinMode(9, OUTPUT);
}

void loop()
{
    // start working...
    Serial.println(&quot;=================================&quot;);
    Serial.println(&quot;Sample DHT11...&quot;);

    // read without samples.
    byte temperature = 0;
    byte humidity = 0;

    int err = SimpleDHTErrSuccess;
    if ((err = dht11.read(pinDHT11, &amp;temperature, &amp;humidity, NULL))
        != SimpleDHTErrSuccess)
    {
        Serial.print(&quot;Read DHT11 failed, err=&quot;);
        Serial.println(err);
        delay(1000);
        return;
    }

    Serial.print(&quot;Sample OK: &quot;);
    Serial.print((int)temperature);
    Serial.print(&quot; *C, &quot;);
    Serial.print((int)humidity);
    Serial.println(&quot; H&quot;);

    if (humidity &gt; 70 )
    {
        Serial.println(&quot;Humidity is above 70%&quot;);
        digitalWrite(9, HIGH);
    }
    else
    {
        Serial.println(&quot;Humidity is below 70%&quot;);
    }
    // DHT11 sampling rate is 1HZ.
    delay(1500);
}