The active ingredients in antibiotic ointments, such as neomycin, bacitracin, or polymyxin B, work by disrupting bacterial cell walls or interfering with bacterial protein synthesis. This action helps to prevent bacterial growth and promotes healing of the affected area.