Button not working correctly. Static bool, Potentiometer. uno

I think that you should learn about button debouncing and the difference between digital and analog inputs.

Do not mix pin 15 and A1, pins by name and number, digitalRead() and analogRead() of the same pin, switch or pot on A1, and use pullups wherever required.