disabling or enabling a public component

I need to be able to disable only a specific component of an object publicly. I got a public component but I cant find any ways on the internet on how to disable and enable that component. Here’s the code:

    public Component script;     void Start()     {     }     void Awake()     {         if (sliderchanged.drop == 1)         {             script.enabled = false; //this is the error         }         if (sliderchanged.drop == 0)         {          }     }     // Update is called once per frame     void Update()     {              }