Script working but still don't get OnClick option.

I have a working script with an OnClick function but when I access the function from the button it doesn’t give me the option…?

void OnClick()
{
    StartCoroutine(MyMethod());
}

IEnumerator MyMethod()
{
    GetComponent<AudioSource>().Play();
    yield return new WaitForSeconds(.5f);
    SceneManager.LoadScene("MainMenu");
}

The OnClick() method has to be pulic. So, change…

void OnClick()

to

public void OnClick()