If you only declare pointer, then always set it to nullptr in header or Constructor for initialization purpose. As for setting value to it - it depends on what logic you are using, there can be many different approaches. For example some do the stuff like picking up mags = adding their params to Character data and destroying mag actor itself, so all info goes to Character.
Get world from outer, when you create object you define it alter usually you put this it defines, if it’s actor you can get world instance
Pass related UWorld* during creation of object and keep it in objects variable and use that pointer insted of (), that what components do in UE4 for example
Per function you can also pass UWorld* as argument of function.
I recommend method 2.
Make sure that outer is actor in world or UWorld* so object get destroyed with the world
As I mentioned above - you should decide when to set it. There are lots of details that are connected with this decision and so there are many different possible solutions…
You reminded me about Paul Halmos phrase “The beginner should not be discouraged if he finds he does not have the prerequisites for reading the prerequisites.” Code isnt born in ideal and perfect shape, perfection is only the result of many steps. So, just be more practical on this - do the job as you can and at some point you will find better solution ))