Welcome to the forum! Please read this topic
to learn how to post code in code or highlight tags and other useful info for new members.
1. Your explanation is still not clear. You say "i cant do anything in my desktop," but then "when i go to the task manager." The latter seems to contradict the former. It sounds like your execution environment is becoming non-responsive while your OS is fine. What is your execution environment? Are you executing from an IDE, from a command shell, or . . . ? You then mention restarting the system. What system are you restarting? Unless the program is simply waiting for more input and you're not recognizing it, there is an error, and it's being communicated to you. You may have to run the application from the command line or become better at using your IDE to see the error, but it's there somewhere.
2. A "search and suggest" or "search and filter" on user input is an algorithm written by the programmer of the application. You may find code in a database context on the 'net that will suggest how to do this, but it's largely your responsibility (and not that hard).