Changing parent to another object in hierarchy from script

As title, im new to unity and programming,
im now trying to move some children from parentA to parentB
but my parentB is an object in hierarchy
the below is my code

his.transform.parent = parentB;

thankyou

You can do
GameObject.Find("name of your object")
This should return you the gameobject you need.
Now you can do
childobject.transform.parent = GameObject.Find("name").transform

I’m not exactly sure what you mean.
But to parent something use this

someChild.transform.parent = someParent.transform;