I want to remove amazon.com from my search result because I do not use it and it can include half of my search results.
I have it in my hosts file at 127.0.0.1, but I want the search results removed also.
Not really a proper way since you're querying something else and it's answering. You need to change your query. Can add "-amazon" to most any search engine and it should remove anything related to Amazon.
First image below has "-amazon" and it doesn't show up, but regular search has it as second hit. It's not perfect but it's a start.
As per above the search engine doesn't use your local resolution when displaying site matches, so hosts filing amazon.com won't really do anything. Also your browser will likely try www.amazon.com and the page would still load as that is a different subdomain than the root record.
Using exclusion search functions as above would behave how you want, otherwise there would be zero difference in search results when just modifying your local hosts file.
There seems to be a few 'amazon blocker' browser extensions you might have luck with, haven't used any of them personally though. Sometimes extensions can get a lot of extra data that they don't really need to have.