How to define a function seperate from the class in which it must called?

What I wish to achieve is similar to the functions that Unity has already provided for us, such as their Update functions. Where they must be called is already placed, and we define their tasks. However, it still carries out all definitions of that function. For additional context, I am writing a base script for player movement and would like to write state methods, if that makes sense. For example:

public class Example : MonoBehaviour {

	if( grounded )
	{
		OnGroundedStay();
	}
}

public class SeperateScript : MonoBehaviour {

	void OnGroundedStay () 
	{
		//Perform unique tasks when we remain on the ground.
	}

Thank your for your time, and I apologize for the bluntness of the explanation.

To call the method/function OnGroundedStay() a reference is first required to the class in which it is defined. The class Example could be something like:

 public class Example : MonoBehaviour {
 
     if( grounded )
     {
         SeparateScript otherScript = new SeparateScript();     //Creates reference to other class
         otherScript.OnGroundedStay();                                      //Invoke specific method in class
     }
 }

Essentially its the class reference that is needed and then call any of the public methods within it. Note, private methods of referenced class cannot be accessed outside of the class.