While aminoglycosides are not directly used to treat cancer, they play an important role in managing secondary infections in cancer patients. Cancer treatments such as chemotherapy and radiation therapy can weaken the immune system, making patients more susceptible to bacterial infections. In such cases, aminoglycosides are used to combat these infections and ensure the patient can continue their primary cancer treatment.