Alexa + ESP32 project

Here's how it works: The Arduino pin goes HIGH to turn on the transistor. When it does, it forward-biases the Base-Emitter junction which then causes the Collector-Emitter terminals to go into saturation. When the relay is connected to 5V and the other end to the COLLECTOR, it turns on the relay.
It's also worth mentioning you will need a 1N4004 diode across the relay coil. Cathode (stripe) to +5, and anode to COLLECTOR. This is needed to "catch" the inductive spike from the relay coil so it doesn't zap your transistor.