The purpose of an adrenalectomy is to remove one or both of the adrenal glands. This surgical procedure is often performed to treat adrenal tumors, such as adrenal adenomas or adrenal carcinomas. It may also be recommended to manage conditions like Cushing's syndrome or pheochromocytomas.