Which type of cell is responsible for causing apoptosis in cancer cells and virus-infected cells?
Natural killer (NK) cells.
NK cells are a type of cytotoxic granulated lymphocyte responsible for inducing apoptosis in "faulty" cells (such as the cancer cells and the virus-infected cells that you mentioned).
Their granules contain granzymes, which opens pores in the cell membranes of cells marked to kill and releases granzymes and associated molecules required for apoptosis into the cell. Hope this helps!