RS485 Using Mega2560

The Serial pins are here: https://www.arduino.cc/reference/en/language/functions/communication/serial/.
As soon as you use Serial1, then it exists, and as soon as you call Serial1.begin(...) then the hardware is initialized.

void setup()
{
  Serial1.begin( 9600);  // activate pin 19(RX), 18(TX)
}

If the library can use another serial port, that depends on the library that you use.

Do you want to use the official ArduinoModbus library ?
That is made for the MKR 485 Shield.

The same question was asked here: https://forum.arduino.cc/t/arduino-modbus-library/602283

I think you have to look for another library.