How to exclude or prevent users from search below keywords all, docs, test etc, if users search using these keywords SharePoint search must not display any results.
While I agree with the answer by Morten K in that there are always ways to get around a keyword exclusion, it does not accurately respond to the question.
You can find a way to run query rules that cause exclusion of certain keywords here: Exclude Keywords from Search
What's the reason for this? If it is to prevent the users from getting their hands on files they shouldn't then it's a no go. There's literally several other way to surface the files other than search.