A quick tutorial on how to create a flashlight and assign it to your first or third person character.
So, the steps are pretty simple
In your character blueprint
Create a spotlight
Attach it to your weapon
Position it to the end of your gun
Turn the visibility off
In the event graph - toggle its visibility
Assign an Action mapping
and you're good to go.