To activate or deactivate a gameobject by scripting, use the SetActive function.
public class ExampleClass : MonoBehaviour
{
void Start ()
{
gameObject.SetActive(false); //GameObject is activated in hierarchy and will be deactivated when game starts.
}
}