Mechanical ventilation is generally considered when less invasive methods fail to provide sufficient respiratory support. Indications include severe respiratory failure, significant hypoxemia (low blood oxygen), or hypercapnia (high carbon dioxide levels). It is often used in intensive care settings and may be necessary for patients with advanced lung cancer, extensive metastasis, or severe treatment-related complications.