How to give the nearest text that the user has written
This is not an easy task.  There is no simple answer; you could do something crude that might give mediocre results, or you could put a lot of effort into it; and it's not obvious to me what will work best.
One possible simple approach is to map each word (except for a few stopwords) to an encoding, using a standard word embedding (e.g., word2vec), average the vectors of the words to get an embedding of the phrase, and then compare two phrases using the L2 distance of their embeddings.  I don't know how well this will work; you could try it and see.
There will probably be more sophisticated approaches, e.g., training a language-based model to compare two phrases for similarity, perhaps building on an existing model (such as BERT) and fine-tuning it.  I anticipate this will require many labelled samples and a non-trivial amount of research and experimentation, so it's not a minor project to take on.