Antimicrobials work by targeting specific structures or functions within microorganisms. For example, antibiotics like penicillin inhibit cell wall synthesis in bacteria, leading to cell death. Antivirals may block viral entry into host cells or inhibit viral replication. Understanding the mechanisms of action helps in choosing the right antimicrobial for a given infection.