How do I create a custom script/function field similar to the OnClick() box used on the buttons?

I want to be able to call public functions with a field similar to that used for the OnClick() function on button UI components. How would I be able to add a box like this to my own scripts?9470114--1330880--upload_2023-11-14_17-10-44.png

You could use UnityEvents. Then you’d have to invoke the UnityEvent, but you can hook things up to it in the inspector.
Try this youtube video for a better explanation.