how to find any component of gameobject itself in untiy

Code Example - how to find any component of gameobject itself in untiy

                
                        GetComponent<ObstacleSpawner>().enabled = false;
GetComponent<CameraScript>().enabled = false;