Antibiotics treat bacterial infections by either destroying cell walls or preventing reproduction. Some antibiotics may also have anti-inflammatory properties that can help other types of illnesses.