Antibiotics are a class of drugs which were discovered to be effective against bacterial infections, strictly speaking, they are called antibacterial chemotherapeutics; meaning they are drugs which selectively target bacteria. They target specific parts of the bacterium like; enzymes, cell wall components, and bacteria specific metabolic processes. Because these targets and generally specific to bacteria, the harm caused by these drugs to human cells is reduced. This is because the target of the drug is not present in human cells, and therefore the drug cannot harm those cells.
It is for this same reason that antibiotics are not effective against viruses. The targets of the drugs are not present within the virus, and therefore the drug is not effective against viral infections. Therefore if someone's infection is caused by a virus (for example influenza) and not by bacteria (for example Tuberculosis), antibiotics will not benefit the patient; they could even cause harm.