A needle biopsy is typically performed when imaging tests like X-rays, CT scans, or MRIs reveal abnormal tissues or masses. These tests can suggest the presence of cancer, but a biopsy is necessary to confirm the diagnosis. The procedure helps doctors determine the nature of the abnormality, whether it is benign or malignant, and the extent of the disease.