Starting Serial.begin(9600) breaks button function

What I'm trying to do is have a button that when pressed, turns on a circuit for the potentiometer to turn on the LED based on a reading from it (0, its off, 1+ its on). I can get the potentiometer and button to work independently of eachother, but when combined and I add the Serial.Begin(9600) line it seems to break it and doesn't make the button work.

int bpin = 1; //Button Pin
int lpin = 4; //LED Pin
int ppin = 7; //Potientometer Pin

boolean running = false;

void setup() {
  pinMode(lpin, OUTPUT);
  digitalWrite(lpin, LOW);
  pinMode(bpin, INPUT);
  pinMode(ppin, INPUT);
  Serial.begin(9600);
}

void loop() {


if (digitalRead(bpin) == HIGH) {
  running = !running;
}
if (digitalRead(bpin) == HIGH && running){
 running = !running;
}
if (running){
  Serial.println(analogRead(ppin));
  digitalWrite(lpin, HIGH);
  delay(analogRead(ppin));
  digitalWrite(lpin, LOW);
  delay(analogRead(ppin));
  
}
}

Pins 0 and 1 are on almost all Arduinos are connected internally to the serial/USB interface. This means you can't use them with anything else if you need Serial to work too.

It looks like your button is connected to pin 1 - try using pin 2 (etc) instead.

Here is your code modified a bit, that might help.

int bpin = 2; //Button Pin
int lpin = 4; //LED Pin
int ppin = A0; //Potientometer Pin

boolean running = false;

void setup() {
  pinMode(lpin, OUTPUT);
  digitalWrite(lpin, LOW);
  pinMode(bpin, INPUT);
  Serial.begin(9600);
}

void loop() 
{
  if (digitalRead(bpin) == HIGH) {   //this might not detect the state change 
    running = !running;              //StateChangeDetection example may help with that
  }
  if (running)
  {
   Serial.println(analogRead(ppin));
   digitalWrite(lpin, HIGH);
   delay(analogRead(ppin));
   digitalWrite(lpin, LOW);
   delay(analogRead(ppin)); 
  }
}

I feel that there are more problems than just the Serial.begin(). The Potientometer is connected to a digital pin and you are trying to read the analog value(assuming you are using Arduino Uno). Change the ppin to an analog pin.

Here in the checking part,

if (digitalRead(bpin) == HIGH) { running = !running; } if (digitalRead(bpin) == HIGH && running){ running = !running; }

when the button is pressed, the running becomes true. In the next statement it checks if the running is true, and change it back to false. Try using 'else if' instead, but that statement I don't think is necessary.

if (digitalRead(bpin) == HIGH) {
  running = !running;
}

This alone could do. And if you want to turn it off using the same button, you might have to detect the state change in between the blinking too.

The Potientometer is connected to a digital pin

No, it isn't. OP is using the name that should be used when referring to the analog pin as a digital pin, but the analogRead() function is smart enough to know that the user is wrong.

Reading the potentiometer three times is unnecessary. Read it once. Print what was read, and use that value in both calls to delay().

Aye, thanks for all the help guys. Didn't know the board moved this fast so I didn't check until now. Moved the bpin to 2 and moved the ppin to A0, worked perfectly. Thanks for all the help.