How to get a custom component declared by variable?

This is basically what I want:

public Component theComponent;    
public GameObject objToAnswer;
public Color color;

 public void Finished()
 {
          objToAnswer.GetComponent<theComponent>().ReturnColor(color);
  }

Return.requestComponentBehaviour' is a "field" but a "type" was expected

I understand that I can’t do this way, but there’s another approach to achieve this result, I mean getting a custom component?

Also, just to clarify, the component would then be set in Unity Editor, so I guess I can’t cast as something, because I don’t know what would be anyway.

hi;

   public Behaviour component;

with this u can assing any component to the editor;

but i think u can just enable or disable it this way ;

if u want to run function or do any thing u have to check for the compoennt Type :