Close on Esc. Key?

UPDATE: I just created a “main” C# script in the game’s “Scenes” folder alongside the SampleScene. I looked up a similar entry on the forum , and I drew inspiration from that to write some code in my “main” script. After that, I hit “Build & Run” and pressed the Escape key when the program started running, but it wouldn’t close the game. Is there something I could do to make the code work. The code for my new “main” script is as follows:

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

public class main : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(“escape”)) {
Application.Quit();
}
}
}