Reconfirming the comments above, the issue resides in your use of the "while" condition; the condition referenced can be true or false.
example:
int x;
while (x < 5){
x++;
}
Anyhow, obviously you're new and trying figure out and build a foundation of learning; below is the only code you need:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(2000);
}