asser do you not have a function that captures mouse or whatever input you use for triggereing stuff on the NPC?
Create a function - open_dialog() inside the NPC script, then on the main word script, have a function on_mouse_click() or whatever. in that function you create raycast that shoots ray from camera through your mouse position on screen and if ray hits your NPC you get the body object in the result, then you cast this body as your NPC class and access the body.open_dialog() function.
If you use keyboard or any other input then it might be more complex. YOu need to have a way to toggle the NPC. Figure this out first then you can use that knowledge to do dialog stuff