DHT 11 Returns NaN All The Time

I’m Uploading This this Code :

#include <DHT.h>
#include <ESP8266WiFi.h>
/*
  #include <ESP8266WiFi.h>

  const int MPU_ADDR = 0x68;
  int16_t accelerometer_x, accelerometer_y, accelerometer_z;
  int16_t temperature;
  const char* ssid = "FutureZone2";
  const char* password = "Windows99";
  String header = "";
  WiFiServer server(80);
*/

DHT dht(D1, DHT);
//int counter = 1;

void setup() {
  Serial.begin(9600);
  /*
    WiFi.begin(ssid, password);
    Serial.print("Connecting \n[");
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print("|");
    }
    Serial.println("]");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
    server.begin();
  */
  dht.begin();
  pinMode(D2, OUTPUT);
  pinMode(D6, INPUT);
}

void loop() {
  /*
    WiFiClient client = server.available();

    while (client.connected()) {
    //Serial.println(">>Client Connected");
    String currentLine = "";
    if (client.available()) {             // if there's bytes to read from the client,
      //Serial.println(">>Client Available");
      char c = client.read();             // read a byte, then
      Serial.write(c);                    // print it out the serial monitor
      header += c;
      if (c == '\n') {                    // if the byte is a newline character
        if (currentLine.length() == 0) {
          if (header.indexOf("GET /status") >= 0) {
            Serial.println("Getting status HTML....");
            client.println("HTTP /1.1 200 OK");
            client.println("Content-type:text/html");
            //client.println("Connection: close");
            //client.println("Refresh: 5");  // refresh the page automatically every 5 sec
            client.println();
            client.println("<!doctype html>");
            client.println("<html>");
            client.println("  <head>");
            client.println("    <title>CoGo Status</title>");
            client.println("    <meta http-equiv=\"refresh\" content=\"5\"/>");
            client.println("    <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css\">");
            client.println("  </head>");
            client.println("  <body>");
            client.println("    <h1>My Stats</h1>");
            client.println("    <h3>");
            client.println(counter);
            client.println("    </h3>");
            counter++;
            client.println("    <div class=\"progress\">");
            client.print("      <div class=\"progress-bar\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"");
            client.print(temperature / 340 + 36.53);
            client.print("\">");
            client.print(temperature / 340 + 36.53);
            client.println("%     </div>");
            client.println("    </div>");
            client.println("    <script src=\"https://code.jquery.com/jquery-3.5.1.slim.min.js\"></script>");
            client.println("    <script src=\"https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js\"></script>");
            client.println("    <script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js\"></script>");
            client.println("    <script>");
            client.println("      var val = $(\".progress-bar\").attr(\"aria-valuenow\");");
            client.println("      if(val > 0 && val < 90)");
            client.println("      {");
            client.println("        $(\".progress-bar\").attr(\"class\",\"progress-bar bg-success\")");
            client.println("      }");
            client.println("      if(val > 90 && val < 100)");
            client.println("      {");
            client.println("        $(\".progress-bar\").attr(\"class\",\"progress-bar bg-warning\")");
            client.println("      }");
            client.println("      if(val > 100)");
            client.println("      {");
            client.println("        $(\".progress-bar\").attr(\"class\",\"progress-bar bg-danger\")");
            client.println("      }");

            client.println("      setInterval(function(){");
            client.println("         window.location.reload(1);");
            client.println("      }, 5000);");

            client.println("    </script>");
            client.println("  </body>");
            client.println("</html>");
            client.println();
            Serial.println("HTML generation completed....");
            break;
          }
        } else { // if you got a newline, then clear currentLine
          currentLine = "";
        }
      } else if (c != '\r') {  // if you got anything else but a carriage return character,
        currentLine += c;      // add it to the end of the currentLine
      }
    }
    }
    // Clear the header variable
    header = "";
    // Close the connection
    client.stop();

    //Serial.println("Client disconnected.");
    //Serial.println("");
  */
  if (digitalRead(D6) == HIGH && !isnan(dht.readTemperature())) {
    digitalWrite(D2, LOW);
    delay(5000);
    digitalWrite(D2, HIGH);
    Serial.println(dht.readTemperature());
  }
  if(isnan(dht.readTemperature())){
    Serial.println("Failed To Read From Sensor :-(");  
    return;
  }
}

trying To Get My DHT 11 To Work But It onlys Prints:

Failed To Read From Sensor :-(
Failed To Read From Sensor :-(
Failed To Read From Sensor :-(

CAN ANYONE PLEASE HELP
:frowning: