LED light with Potentiometer and Button

Good Morning!
I need a ARDUINO UNO Code with this settings.
First, LED connected to breadboard. So to breadboard connected potentiometer and button.
When you interact with potentiometer, LED is not working. When you press button, potentiometer will interact with LED and LED will work. I need a code. Im a novice in arduino, pls help me.

First, get this working. That will adjust the led as the pot is turned.

Then second, since that's not what you actually want, hook up the button from a pin to ground, with pinMode at input pullup.

Wrap the first code in an "if" so that the first part only works when the button is low.

Get the first part sorted first, then come back if you need help with part 2.

Your code is here

/*
 * Created by ArduinoGetStarted.com
 *
 * This example code is in the public domain
 *
 * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-potentiometer-fade-led
 */

int LED_PIN = 3;  // the PWM pin the LED is attached to
int BUTTON_PIN = 4;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);

  // declare LED pin to be an output:
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the state of the switch/button:
  int buttonState = digitalRead(BUTTON_PIN);
  
  if(buttonState == LOW)
  {
    // reads the input on analog pin A0 (value between 0 and 1023)
    int analogValue = analogRead(A0);

    // scales it to brightness (value between 0 and 255)
    int brightness = map(analogValue, 0, 1023, 0, 255);

    // sets the brightness LED that connects to  pin 3
    analogWrite(LED_PIN, brightness);
  }
}

If you are new to Arduino, you can learn more here: