Switching 5V

Hello!

I am using a relay that I am wanting to activate using 5V. However, I am wanting the 5V to activate the relay based on input from a sensor attached to the Arduino.

Is there a way to take the 5V from the Arduino's 5V pin and somehow use a transistor to switch on/off the 5V while interfacing with the external sensor.

Thanks in advance!

Yes. Have a look at these drawings showing how hardware is connected.

An Arduino cannot drive a relay or motor by itself, instead a power supply and a driver (transistor, board, shield...) is required.