Button working with delay when releasing it

Hello everyone. First of all, I would like to clarify that I'm pretty new to coding, and I'm using an ATTiny88.

I have created a simple sketch to test if my button is working as expected, using a simple code to make an LED strip turn red when pressing the button, and blue when releasing it. However, when I release the button, it takes a couple of seconds to turn blue again.

Also, I don't have an Serial Monitor Module to use with the board.

Is this a fault of my board? Or is this how the void loop function should actually work?

This is my code;

#include <FastLED.h>

#define NUM_LEDS 40
#define LED_PIN 3

const int buttonPin = 6;

CRGB leds[NUM_LEDS];

int buttonState = 0;

void setup() {

  pinMode(buttonPin, INPUT);
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.setBrightness(50);
}

void loop() {

  buttonState = digitalRead(buttonPin);


  if (buttonState == HIGH) {

    leds[0] = CRGB::Red;
    FastLED.show();
  } else {

    leds[0] = CRGB::Blue;
    FastLED.show();
  }
}

And here, this is how it looks:

https://www.youtube.com/shorts/IE8iWj14sQ0

How is your switch wired? Is it pulling the input pin to ground and do you have a resistor passively pulling the pin high when the switch is not pressed?

Sorry for the wiring mess. I'm not using any resistor at all. Do I have to connect it to the button pin that connects to the ground line on the board?

What your code is doing is:
as long as your button is not pressed the IO-pin catches up electromagnetic noise which makes the LED react with a delay

If you have connected the button between IO-pin and ground you have to change the pinMode from

to

pinMode(buttonPin, INPUT_PULLUP);

do you see the difference?
instead of INPUT compared to INPUT_PULLUP
This will invert the value read from the button

as long as the button is unpressed digitalRead() results in a HIGH
if the button is pressed down digitalRead() results in a LOW

Here you can read why this is nescessary for reliable function:

best regards Stefan

Google: floating input pin.