How To Make A Flashlight In 3D Space

How do I…

How do I make a flashlight in a 3D scene like “Night Shift”, Im making a horror game in 3D and to make it scary I made the scene very dark and the player will need a flashlight, I got the inspiration to make a horror game from the game Night Shift on gd.games, but I have no clue how they made the flashlight in their game work. Heres the link to the game, NIGHT SHIFT | Play on gd.games

What is the expected result

I want to be able to have a toggleable flashlight that lights up the surrounding area.

What is the actual result

There is no result because everything I tried didn’t work.