Defamation laws vary from state to state but generally, to prove libel or slander, the following has to be established:
The statement was published - The act of "publishing" the statement means that a third party witnessed the statement. The act of publishing means the statement was made public by some means, such as printed in the news, posted on social media, online comments, television, conversation, leaflets, signage, an email that third parties would see, and any other sort of print or oral communication. The critical factor is that it was made public, and others heard or saw the statement.
The statement was false - Generally, the statement made must be false to be considered damaging under the law. Someone saying something unkind or rude about you doesn't equate to defamation if it's true. Opinions cannot be considered defamation because they cannot be proven false. For example, if you own a restaurant, and a food critic writes something like, "I had the worst lasagna of my life at XYZ restaurant," that statement wouldn't be defamatory since it's the food critic's opinion. Nobody can know what their experience with lasagna has been.
The statement caused an injury - If someone says something false about you that does not result in harm, you probably wouldn't have a case. For example, if someone says you smoke marijuana and nobody cares, that likely wouldn't make a great defamation case. However, if someone makes a website about you falsely claiming that you steal from your clients and you lose clients because of it, that would make a pretty strong case because the lies cost you financially. Another example would be if someone claimed you were an abusive spouse and the stress caused you to have a heart attack. That would be an actual injury that could qualify a case for slander or libel.
The statement does not fall under a privileged category - The last element that needs to be satisfied is that the statement does not fall under a privileged class. For example, in a courtroom or under deposition, a witness can make false statements and cannot be held liable for defamation. Of course, they risk prosecution for perjury, but they can't be held liable in a defamation case. Other proceedings that protect lawmakers from being held liable for defamatory statements are statements made in a legislative chamber or official matters. Under these circumstances, freedom of speech is paramount.