Programming Error

I am not sure where but i think i made an error in the way i wrote my code. I am trying to have the led blink when the photo resistor reads a low value and when it reads a high value i was it to stay on solid. Here is the code that i have writen any help would be welcomed.

int sensePin =0;
int ledPin = 9;
void setup(){
  analogReference(DEFAULT); //isn't nessary
  
  pinMode(ledPin, OUTPUT);
  
  Serial.begin(9600);
  
}

void loop() {
  int val = analogRead(sensePin);
 
 if(val < 25)digitalWrite(ledPin, LOW);
 delay(700);
 digitalWrite(ledPin, HIGH);
 delay(700);
 else digitalWrite(ledPin, HIGH);

 
 
 Serial.println(analogRead(sensePin));
 delay(500);
 
}

Need some { }s to organize the commands associated with the if & else:

if(val < 25)
{
digitalWrite(ledPin, LOW);
 delay(700);
 digitalWrite(ledPin, HIGH);
 delay(700);
}
 else
{ 
digitalWrite(ledPin, HIGH);
}

I think that i put these in the correct spot but when the val is high the led is off not on. Maybe is did it wrong again?

int sensePin =0;
int ledPin = 9;
void setup(){
  analogReference(DEFAULT); //isn't nessary
  
  pinMode(ledPin, OUTPUT);
  
  Serial.begin(9600);
  
}

void loop() {
  int val = analogRead(sensePin);
 
 if(val < 25)
 {
   digitalWrite(ledPin, LOW);
   delay(700);
   digitalWrite(ledPin, HIGH);
   delay(700);
 }
 else 
 {
   digitalWrite(ledPin, HIGH);
 }

 
 
 Serial.println(analogRead(sensePin));
 delay(500);
 
}

Try this:

int sensePin = A0;

You have the LED wired correctly?
Arduino pin 9 to LED anode, LED cathode (flat edge) to ~1K resistor, other leg of resistor to Gnd.

Or better - use D13 for initial test, that's the onboard LED and is wired correct for sure.

but when the val is high the led is off not on.

I don't see anything in your code that shows that you know what val is.

Doesn't this line do the analogread?

void loop() {
  int val = analogRead(sensePin);
 
 if(val < 25)

What is being seen in the Serial monitor?

Serial.println(analogRead(sensePin));

thank you it works now i have to change the wiring of the light.