How to center anchor to the center of an object

how do i set the anchor position to the center of the colorrect. i need this to center an object to the viewport but it centers by the anchor instead of the object. this is just a demonstration

Press the green circle button at the top tool bar to edit anchor position

i did, went to a new scene to center it but it still centers it by the anchor instead of the object

What exactly do you mean? Do you mean that you want to change the position of the origin of the Control node?