Depends what's your game, but I have an RTS in the making where I have exported arrays in a global_database script/node autoload.
@export var units : Array[r_unit]
@export var buildings : Array[r_building]
So when I want to access those ressources, I just call :
GlobalDatabase.units[0] will reference the first unit in the units array.
And if I want a building that can recuit units, I can just have an array inside that building that contains IDs that will reference the GlobalDatabase.units array