Linker error after adding the RS485 library

This is the wrong way. Only add

#include <ArduinoRS485.h>

The intellisense error will go away after doing a Ctrl+Shift+P → Rebuild Intellisense.

And well, as you can read in

the RS485 library will, if RS485_SERIAL_PORT is not externally defined, try to use SERIAL_PORT_HARDWARE as its serial port, which as you can see in

is Serial.

As you can read in the documentation

https://docs.platformio.org/en/latest/plus/debug-tools/avr-stub.html#debugger-limitations

and in the code

The AVR-stub code also by default tries to use the Serial object to host the GDB server.

And thus, you have a serial port conflict.

If you wanted to use Serial3 for the RS485 port / transceiver module, add

build_flags = -DRS485_SERIAL_PORT=Serial3

to the platformio.ini (docs).

If it was intentional to use the RS485 library with the default Serial port, you must connect an additional USB-UART adapter to a free serial port and set AVR8_UART_NUMBER accordingly to host the AVR stub server on that serial interface, e.g.

build_flags = -DAVR8_UART_NUMBER=3