Easy question: 3D MASK or equvilient?

Hey guys so right now im going slow on my game making and ive decided to start on a different area.

Pretty much the player walks up to the trader ( NPC ), and when in proximity a small picture will pop up showing what button to press to interact ( i can do this myself )

But how can i assign a certain area, when the interaction button is pressed , that trader and the code that comes with him is initiated?

So say i'am 5 meters from the NPC, and i press the action key , a Shop/inventory GUI pops up. How do i get the game to understand the proximity of the player to the trader?

kinda like a mask..? ( I'am pretty new to unity )

EDIT:

Maybe if i make a cube and put it on the " trader " and put a mesh collider on the cube, if that works, i have no idea how to call up the mesh collider and tell it what to do.

Just abit of help here guys ( sorry if i made this more confusing than it should be )

you can make a collider around the trader, and then on every time hes in the trigger (make the collider a trigger) using OnTrigger() check if the tag is "Trader" and then if he presses E (or w/e button) then it will activate the trader script, by referencing the trader and telling it to activate. Or, how my game does it, it is all raycast based, so when i am looking at a trader, and press E i will get his shopkeep script, and open the menu, OR, if im looking at an item, ill pick it up, OR, if im looking at an enemy, i will attack it. The best part about this is, you already have a way to detect what the player is looking at, now you can edit it, based off of new things they need to look at in the game, such as a button on the wall. All it does is it makes a raycast from the camera, and puts it forward, a certain distance. This way is more difficult, but gets better results, because it means you have to be LOOKING at the trader to press E, not just near him. Then you can just make a distance check (Vector3.Distance(transform.position, hit.transform.position); //kinda like this) to check if hes a certain distance from the camera.

just to make the m50's answer easier to understand. you can use Physics.Raycast to shoot a ray in a direction and see if it collides with anything then based on the name or tag of the other GameObject you can run a script or function or ... the other way is to add a sphere collider to the NPC and check it's "is trigger" property in the inspector and then when you go inside of it's range (that you can change by changing the radius of the sphere collider) it will run the OnTriggerEnter function and you can check if the other GameObject that entered the trigger area of NPC is player then execute what you want. a code example would be like this

OnTriggerEnter (other:Collider)
{
   if (other.name == "player") dosomething();
}