How do i turn ongui to Ugui or the new gui

How do i turn ongui to Ugui or the new gui. heres my script can you help me transform it into a ugui or unity’s newest ui.

//Copy right of brayden roberts aka brayT
using UnityEngine;
using System.Collections;
public class CaptureController : MonoBehaviour {
public bool  blueTeam;
public bool  redTeam;
private float redcapturePerc = 0;
private float bluecapturePerc = 0;
//FLAGS
public GameObject flagRed;
public GameObject flagBlue;
public GameObject flagNeutral;
void  Start (){
    flagRed.GetComponent<MeshRenderer>().enabled = false;
    flagBlue.GetComponent<MeshRenderer>().enabled = false;
    flagNeutral.GetComponent<MeshRenderer>().enabled = true;
}
void  Update (){
    if(blueTeam == true)
    {
        bluecapturePerc += Time.deltaTime * 15;
        redcapturePerc -= Time.deltaTime * 15;
    }
    if(redTeam == true)
    {
        redcapturePerc += Time.deltaTime * 15;
        bluecapturePerc -= Time.deltaTime * 15;
    }
    if(redTeam == true && blueTeam == true)
    {
        redcapturePerc = redcapturePerc;
        bluecapturePerc = bluecapturePerc;
    }
    if(redcapturePerc >= 100)
    {
        redcapturePerc = 100;
        flagRed.GetComponent<MeshRenderer>().enabled = true;
        flagBlue.GetComponent<MeshRenderer>().enabled = false;
        flagNeutral.GetComponent<MeshRenderer>().enabled = false;
    
    
    }
    if(bluecapturePerc >= 100)
    {
        bluecapturePerc = 100;
        flagRed.GetComponent<MeshRenderer>().enabled = false;
        flagBlue.GetComponent<MeshRenderer>().enabled = true;
        flagNeutral.GetComponent<MeshRenderer>().enabled = false;
    
    }
    if(redcapturePerc <= 50 && bluecapturePerc <= 51)
    {
        flagRed.GetComponent<MeshRenderer>().enabled = false;
        flagBlue.GetComponent<MeshRenderer>().enabled = false;
        flagNeutral.GetComponent<MeshRenderer>().enabled = true;
    
    
    }
    if(redcapturePerc <= 0)
    {
        redcapturePerc = 0;
    }
    if(bluecapturePerc <= 0)
    {
        bluecapturePerc = 0;
    }
}
void  OnGUI (){
    GUI.Box( new Rect(10, 10, 200, 25),"Red Cap" + " " + redcapturePerc.ToString("0") + " " + "Blue Cap" + " " + bluecapturePerc.ToString("0"));
}
}

The newer GUI works totally differently than the old one. Just go through one of the many tutorials on it. For converting, you’d most likely create a scene object or prefab with the appropriate UI components attached, have references to components like Text (or text mesh pro), and then access those references in your script to change what text is displayed.