Newbie usually runs into trouble when using two power supplies. A lot of people asked on the forum about the same issue.
1. Two power supplies use cases:- one for Arduino, one to provide the extra power for motors (Servo motor, stepper motor, dc motor)
- two power supplies for two Arduino, which communicated to each other (via I2C, UART, SPI...)
2. How ToIt's very simple, just connect GND from one to the other.
Example:
This post showed a wiring diagram for using the extra power supply for multiple servo motors.
NOTE 1: In the case of you connect two Arduino to the same PC, GND of two Arduino has been connected to each other via PC.
NOTE 2: If you use some motor drivers, GND may be internally connected.
NOTE 3: The above does NOT apply for the case of using the Relay