how do i make a gameover gui appear

In my gameOver() function I want UI to appear that displays the score and a main menu button. I have already made it but now its just a matter of how do i get it to appear in my function. Is there like a .show() function?

public static void GameOver()
{
	print ("Game Over");
	EnemyAI.clearLook();

	//UI to appear here
}

Something like this?

    using UnityEngine;
    using UnityEngine.UI;
    
    public class test : MonoBehaviour {
    
    	public Text text;
    	int highScore = 9000;
    	void Start(){
    		GameOver ();
    	}
    
    	void GameOver(){
    		print ("Game Over");
    		text.enabled = true;
    		text.text = "Score : " + highScore;
    	}
    }