How to identify pinout of ATmega 2560 derivative board?
Disconnect everything but the switch.
Run this:
for each pin,
  set the pin to INPUT_PULLUP mode;
  do,
    read and print the pin number and pin state;
  until operator touches a key;
  read and discard the serial input;
end;

You do:

Each time a new pin number prints on the terminal,
toggle the switch a few times to confirm whether you are seeing the result of your actions.
If not, touch the spacebar to try the next pin #
else, you found it.