Two power source for Arduino and a relay
The uno can't provide enough power to power an ESP8266 reliably.  I suggest you power it from a separate source.

When ever you use separate power supplies for a circuit you need to "tie the grounds together", connect them.  Otherwise the circuits don't use the same definition of zero.