(C#) Run specified method on event?

Hello, what i’m trying to do is specify a method into a class, and have the class run it, ex:

MainFile:

Button btn;

void DoStuff()
{
 // random code
}

void Start()
{
 btn = gameObject.AddComponent<Button>();
 btn.doClick = DoStuff();
}

Button Class:

public (i don't know what type this is) doClick;

void Start()
{
 doClick();
}

How would I do this? Thank you.

delegate and event is what you are after.

public class Button:MonoBehaviour{
   public delegate void HandlerEvent();
   public event HandlerEvent OnPress = new HandlerEvent(()=>{});
   public void Click(){
      // Do all kind of stuff and defined if the event should be called then call it:
      OnPress();
   } 
}

then in main file:

void Start()
{
 btn = gameObject.AddComponent<Button>();
 btn.OnPress = DoStuff; // No parenthesis, you are passing the address of the method
}

You can have a look there

http://unitygems.com/getcomponent-vs-event/
or here : unitygems.com - unitygems Resources and Information.