How does the immune system eliminate harmful cells?

Once a cell has been recognized, the various effector cells of the immune system use different mechanisms to eliminate it. Macrophages favor phagocytosis, where they engulf and internalize the target for decomposition via lysosomal enzymes and other toxins.1 Alternatively, T cells mainly eliminate their targets by triggering apoptosis. Upon contact with cells marked for removal, T cells release perforins, which destroy membrane integrity in the target cell by creating pores, and granzymes, which are serine proteases capable of triggering apoptotic cascades once active in the cytoplasm. T cells can also induce apoptosis via a perforin-independent method involving Fas ligand-mediated caspase activation.1

Reference:
1. C.A. Janeway Jr., et al., Immunobiology: The Immune System in Health and Disease. 6th edition. New York: Garland Science; 2005.