How do I create a light switch?

I’m trying to create a light switch. I already have an object (rock) that when the character walks up to it it says “Press F to turn on lights”. How to I make it so that when the character does press F a light source will be turned on. I want the character to be able to turn the light on and off as long as they are near the rock. Pictured is what I have so far with my blueprint. Any and all help would be greatly appreciated. Thank you for your time.

Here are tutorials to help you :

and a video : from

Thank you very much for the information. It was extremely helpful.