i think you should change Serial.write() to Serial.print() because Serial.write() is for send data as bytes or series of bytes and Serial.print() send as human-readable text.
Reference:
Serial.write()
https://www.arduino.cc/reference/en/language/functions/communication/serial/write/
Serial.print()
https://www.arduino.cc/reference/en/language/functions/communication/serial/print/
esp 8266 code:
void setup()
{
Serial.begin(9600);
}
void loop(){
Serial.print("hello friend");
delay(2000);
}