How do I get info and/or variables from an object in a socket?

Hi all,
I am studying Unity and I’m a noob on coding. I’m developing a flashlight and a charger. I made everything work, but everything is set on one script which is in the flashlight and when the flashlight is added to the charger’s socket it runs the functions from the “select entered/exited”. I wanted to add a script to the charger instead and get access to the variables of the object I add in there in case I wanted to create different objects to be charged in the same socket.
How do I do it?