This is a good explanation:
https://forum.arduino.cc/t/using-arduino-uno-rx-and-tx-pins-while-comport-through-usb/487318/2