How to end a game when reaching a certain score.

I am trying to make a win screen that pops up when you score 10 points in the game but I’m not sure what to add to get it to work

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayerScript : MonoBehaviour {

public int points;
public const int maxhealth = 4;
public int currenthealth = maxhealth;
public int evades;
public int NumofHearts = 4;

public Image[] hearts;
public Sprite fullheart;
public Sprite emptyheart;

PlayerScript player;
// Use this for initialization
void Start () {
    player = FindObjectOfType<PlayerScript>();
}

// Update is called once per frame
void Update () {
	for (int i = 0; i < hearts.Length; i++)
    {
        if(i < currenthealth)
        {
            hearts*.sprite = fullheart;*

}
else
{
hearts*.sprite = emptyheart;*
}
if(i < NumofHearts)
{
hearts*.enabled = true;*
}
else
{
hearts*.enabled = false;*
}
}
* }*
//public void Takedamage(int amount)
//{
//currenthealth -= amount;
//if(currenthealth <= 0)
// {
// FindObjectOfType().EndGame();
// currenthealth = 0;
// Debug.Log(“Dead”);
// }
//}
public void ApplyDamage()
{
currenthealth–;
if (currenthealth <= 0)
{
FindObjectOfType().EndGame();
// currenthealth = 0;
// Debug.Log(“Dead”);
}
}
private void OnGUI()
{
GUI.Label(new Rect(15, 15, 200, 30), "Keys Collected : " + points);
}
}
Here is the script that controls scoring.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour {
bool gamehasended = false;
* public void EndGame()*
{
if (gamehasended == false)
{
gamehasended = true;
Restart();
}
}
void Restart()
{
SceneManager.LoadScene(“SampleScene”);
}

}
Here is the game manager in case it is needed.

If you want to have a Panel, put this somewhere:

// Set to that object in editor
public GameObject winScreen;

if(points >= 10) winScreen.SetActive(true);

Or you can load a different scene.