Well, you could start with a big if-else
statement just looking for keywords, like Eliza.
When that is not enough then you could move to pairs of ordered keywords and keyword modifiers , like NOT, MY, etc.
When that's not enough then you get in to grammars. You start with simple grammars like the ones used in the old infocom text-based games.
When that's still not enough then you enter the realm of natural language processing. You pick up Russel&Norvig's intro to AI book and then pickup a recent textbook from MIT Press on NLP and go to town on those algorithms.