How do you run a function from 1 script from another C#

Yes, I have googled this for several hours and can’t seem to get this right. All I want to do is run a function in C# from another script. I get this error.

NullReferenceException: Object reference not set to an instance of an object
MenuP01Right.Update () (at Assets/Extras Created/MenuP01Right.cs:13)

Here is the code

using UnityEngine;
using System.Collections;
///////////////////////////////////////////////////////////////
public class MenuP01Right : MonoBehaviour
{
    ///////////////////////////////////////////////////////////////
    public MainMenu mm;
    ///////////////////////////////////////////////////////////////
    void Update ()
    {
        if (Input.GetButtonUp("Fire0"))
        {
            mm.OnNextScreenP1Btn();
        }
    }
    ///////////////////////////////////////////////////////////////
}

and here is the script ‘main Menu’ and the function I want to run

public void OnNextScreenP1Btn()
{
}

So it should be easy. I guess it has something to do with referencing the function improperly.

Check out my answer here.

a. GetComponent

gameObject.GetComponent<MainMenu>().func_name();

b. Static classes ( u can use singleton )

Make the method OnNextScreenP1Btn to public and static