Antibiotics work by targeting and killing bacteria or inhibiting their growth. They do this by interfering with the bacterial cell wall, protein synthesis, or DNA replication. Some antibiotics also disrupt the metabolic processes of bacteria. However, it's important to note that antibiotics are ineffective against viral infections.