check a word against at least 60,000 words?

How would I attach a script or check a word input against at least 60,000 words?
so for example I type in the code word and it checks if the word is correct according to the list of 60,000+ words?
I’m looking for the fastest optimal code to be able to do this

so if word is run" how do I create a script so it checks this word against the 60k + list?

thanks

code is here just about

using UnityEngine;
 using System.Collections;
 using UnityEngine.UI; //MAKE SURE YOU HAVE THIS IN YOUR CODE!



public class open : MonoBehaviour {
     public string codeWord;
     public GameObject inputField;

          void Start ()
     {
         codeWord = "red"; //This is where you set the door code

         inputField = GameObject.Find ("InputField"); //This is where you assign the input field object so you can access your inputField component
          
         inputField.GetComponent<InputField>().text = ""; //This makes it so the input field starts with nothing in it.
     }

     void Update ()
          {
         if (inputField.GetComponent<InputField>().text == codeWord)
         {
             if (Input.GetKeyDown(KeyCode.Return)) //So once you've typed the correct code and pressed enter, it will open the door.
             {
             //Destroy (gameObject, 3);        //Open door
             }
         }

         if (inputField.GetComponent<InputField>().text != codeWord)
                      {
             if (Input.GetKeyDown(KeyCode.Return))
             {
             Destroy (gameObject, 3);//If someone presses enter with the wrong code in the text box, this is where you would make something bad happen to them.
             }
                     }
     }
 }

As mentioned in the comments, you could use a HashSet for this.

To do this create an array of strings from a text file (60k+ words is much easier kept in a file than your actual code)

Convert it to a HashSet and then look up your key value.

public static void Main(string[] args)
        {
            string[] array = File.ReadLines("c:\\file.txt").ToArray();
            var hash = new HashSet<string>(array);

            string key = Console.ReadLine();

            if (hash.Contains(key))
            {
                Console.WriteLine("Contains " + key);
            }
        }

EDIT :: After a few comments, the below code is based off of OP’s code.

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

 public class open: MonoBehaviour {

  public GameObject inputField;
  public string wordsFile = "c:\\file.txt"; // EDIT THIS TO POINT TO YOUR FILE OF 60,000 WORDS

  void Start() {
   inputField = GameObject.Find("InputField"); //This is where you assign the input field object so you can access your inputField component
   inputField.GetComponent < InputField > (wordsFile).text = ""; //This makes it so the input field starts with nothing in it.

   string[] array = File.ReadLines().ToArray(); // This will load a text file into an array of strings
   var hash = new HashSet < string > (array); // this converts the string array to a HashSet, could also use a dictionary for slightly better speed
  }

  void Update() {
   if (Input.GetKeyDown(KeyCode.Return)) { // Check for if they have hit enter 

    string input = inputField.GetComponent < InputField > ().text; // set a string to be what they entered

    if (hash.Contains(input)) // check if the HashSet contains the code they entered 
    {
     // If they get here the code is correct
     // i.e its in the list of 60,000 words
     // do SOMETHING
    } else {
     // IF they get here... then they entered a WRONG CODe
     // i.e not in the list of 60k words
     // DO SOMETHING
    }
   }
  }
 }