ESP8266

PieterP:
Serial.write is used for sending binary data, you want to send text, so use

ESP8266.print("AT\n");

You need to send a line ending as well (\n)
If that doesn't work, try adding a carriage return as well (\r).

ESP8266.print("AT\r\n");

PaulS:
Or, send them in the proper order using println():

ESP8266.println("AT"):

I tried doing that all

#include <SoftwareSerial.h>

const byte rxPin = 0; // Wire this to Tx Pin of ESP8266
const byte txPin = 1; // Wire this to Rx Pin of ESP8266

// We'll use a software serial interface to connect to ESP8266
SoftwareSerial ESP8266 (rxPin, txPin);

void setup() {
  Serial.begin(9600);
  ESP8266.begin(9600); // Change this to the baudrate used by ESP8266
  delay(1000); // Let the module self-initialize
  Serial.println("Sending an AT command...");
 ESP8266.print("AT\n");
  delay(300);
  
}

void loop() {
  
  while (ESP8266.available()){
     String inData = ESP8266.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }  
}

and the only thing that I got on the serial monitor was:
Sending the AT command...
and than nothing.