Code having no issues/errors but does not work

First, I’m sorry if it turns out this kind of problem is asked before and solved, I’ve been searching around the website and find none.
Second, the problem.

I’m a complete beginner, 0% experience, and I’ve been following a YT tutorial on making a dialogue scene. My code down here shows no issues or error messages, and I followed the tutorial correctly step by step, but when I finally press play, the code does not show the output in the game it is supposed to show. I can’t, for the life of me, find the problem and I’ve been asking around for hours now.

Please help by pointing out the mistake I made and give me a solution to it. Thank you.

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

public class DialogueManager : MonoBehaviour
{
    public Image actorImage;
    public TextMeshProUGUI actorName;
    public TextMeshProUGUI messageText;
    public RectTransform backgroundBox;

    Message[] currentMessages;
    Actor[] currentActors;
    int activeMessage = 0;
    public static bool isActive = false;

    public void OpenDialogue(Message[] messages, Actor[] actors)
    {
        if (messages != null && messages.Length > 0)
        {
            currentMessages = messages;
            currentActors = actors;
            activeMessage = 0;
            isActive = true;
            Debug.Log("Conversation Started, loaded messages: " + messages.Length);
        }
        else
        {
            Debug.LogError("No messages provided for the dialogue.");
        }
    }


    void DisplayMessage()
    {
        Message messageToDisplay = currentMessages[activeMessage];
        messageText.text = messageToDisplay.message;

        Actor actorToDisplay = currentActors[messageToDisplay.actorId];
        actorName.text = actorToDisplay.name;
        actorImage.sprite = actorToDisplay.sprite;
    }

    public void NextMessage()
    {
        activeMessage++;
        if (activeMessage < currentMessages.Length)
        {
            DisplayMessage();
        } else
        {
            Debug.Log("Conversation Ended");
        }
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && isActive == true)
        {
            NextMessage();
        }
    }
}