You will probably need to make some adjustments but check out a quick tutorial here below:
First attach your flashlight to your character:
Then put the head in the parent socket.
Adjust the position and you’ll have a flashlight that moves according to the character.
You basically put the flashlight attached to your character’s socket and that alone will make it react to his movement.
I already use it on the head, but on the left or right hand they also bring good results.