In case you work with naked DIP package, the first step is to download its Datasheet and get familiar with pin names and numbering.
The linked page says:
The master Arduino sends the data to the slave trough the orange cable, i.e. master pin 1 (Tx) to slave pin 2 (Rx). If you need to re-upload some code, you should disconnect this cable first.
The note above says the master sends the data to slave via the serial UART.
I would advice you to insert a 470ohm resistor into the Tx->Rx wire in case you mess something up.
Also the grounds have to be interconnected in order to get the serial work.
The arduino bootloader works via Tx/Rx, therefore the advice to disconnect the master-slave wire when updating the sketch.
Messing with naked DIP or SMD atmega328p or atmega32 or atmega1284p, or with 3rd parties boards, requires a
pretty good understanding how the "Arduino Boards pin numbering" vs. "XY Board's pin names/numbering" vs. "DIP/SMD package pin names/numbering" works.
Again, there is a great Arduino forum at
https://forum.arduino.cc/ where the Arduino experts answer almost any question to beginners.