how can i control object with c++

hi , i read tutorials , but tutorials like do that .

1.)File -> Add code to project -> actor
2.) and creating object TSubobjectPtr<USphereComponent> Sphere1; Sphere1 = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT(“Sphere1”));

this is ok , but if my object created before in the wiew port and i want to add c++ code later , how can do this. what type of this ??? Gamemode?