Switch Input to Arduino Serial to Arduino Serial Output Led High or Low.

Here's what I have =

const int buttonPin = 5;    
const int TxPin = 0;
const int RxPin = 1;

// variables will change:
int buttonState = 0;         

void setup() {
 
      
 
  pinMode(buttonPin, INPUT);    
}

void loop(){
  
  buttonState = digitalRead(buttonPin);

  
  if (buttonState == HIGH) {    
     
     Serial.write(TxPin,45;  
  }
  else {
    
    digitalWrite(TxPin, LOW);
  }
}
const int ledPin =  7;      
const int TxPin = 0;
const int RxPin = 1;

void setup() {
 
  pinMode(ledPin, OUTPUT);      
 
 
}

void loop(){
  

  
  if (Serial.println("45")LedPin == HIGH) {    
    
   
  }
  else {
    
   Serial.pintln("45")(ledPin, LOW);
  }
}