Antimicrobials work through various mechanisms. For instance, antibiotics may target bacterial cell walls, protein synthesis, or DNA replication. Antivirals may inhibit viral entry into cells or interfere with viral replication. The specific mechanism depends on the type of microorganism being targeted.