Sometimes you have to set active the whole game object but in case of UI text, you can also enable/disable just that component script. That ways the gameobject is still “active” only the text isn’t drawn.
Any Renderer component can be enabled or disabled to show/hide. This is often preferable to setting the whole GameObject active/inactive, but that depends on your case. Note that GameObject.Find() will not work on inactive GameObjects…though you should rarely, if ever, use that function anyways…better to have a public slot for the GameObject and drag it in the Inspector.
Also note that if you have a Collider, but set the Renderer to disabled, it will still register collisions, but be invisible! So you’d need to disable the Collider as well, usually.