Analog Read stops led from working

Hello guys, what I'm trying to do is light up a led when it gets dark. I'm fairly certain I have connected everything correctly (example) and I have used the right pins for my code.

When I try to use analogRead I lose control of the led, I can't turn in to HIGH.
Any idea why this happens? I have tried to use delay(), millis() and yield() but with no results.
Both the LED and photoresistor work seperetely.

const int led = 6;   
const int ldr = A0;
int ldrStatus = 0;

void setup() {

  //Serial.begin(9600);

  pinMode(led,OUTPUT);
  pinMode(ldr,INPUT);
  
}

void loop() {

  int ldrStatus = analogRead(ldr);
  //Serial.println(ldrStatus);
  delay(200);

    //if (ldrStatus <=500) 
    //{
      digitalWrite(led,HIGH);
     // delay(200);
    //}
    //else 
   // {
     // digitalWrite(led,LOW);
      //delay(200);
    //}
}

Please post a schematic of your actual project rather than a link to what the wiring should be. A 'photo of a pencil and paper drawing is good enough

What values do you see when you un-comment this line?

Please, be more descriptive. Do the LEDs adjust with light changes? Do they not change to what you hope? Pro-tip: You do not need to turn your lights off to see the change... you can just cover the LDR.

Normal values depending on the lighting mostly around 200-500 with minimal change if I don't change the lighting.

The LEDs cannot be controlled, for example my commented code should just turn the LED to high but it doesn't work if I don't comment out the analogRead line.

Thank you for the tip, I have that in mind.

Which Arduino are you using?
I tried it on an UNO and it works

Yes, the LEDs can be controlled, either ON and OFF, or by the use of PWM. https://docs.arduino.cc/learn/microcontrollers/analog-output/

If you are using an Arduino Uno or Nano, you have the output LED on pin 6, which is a PWM pin.

Try this sketch just for your LED on a PWM pin...

// fade.ino

byte PWM_LED = 6; 
byte step = 5;          // size of each PWM step
byte wait = 20;         // time between PWM changes

void setup() {
  pinMode(PWM_LED, OUTPUT);  // configure PWM pin for output
}

void loop() {
  for (int i = 10; i < 256; i += step) {  // create changing values to fade brighter
    analogWrite(PWM_LED, 255 - i);        // write the PWM value
    delay(wait);                         // pause for viewing effect
  }
  for (int i = 0; i < 246; i += step) {  // create changing values to fade dimmer
    analogWrite(PWM_LED, i);        // write the PWM value
    delay(wait);                         // pause for viewing effect
  }
}