How to disable an object

Hi,
I have a little problem. I have an object, with an attached script, this object has a public variable where I introduce a object in the unity editor. Now I want a function on my script to enable or disable this object on game. There is a function for it?
Lot of thanks

GameObjects can be enable/disabled using the active attribute.

Scripts (and other Behavior objects) can be enabled/disabled using the enabled attribute.

To disable children, you need to iterate the transform or iterate the child-components and disable the Behavior objects or GameObjects needed.