Inclusion Criteria:  Histologically confirmed acute myeloid leukaemia (AML) or acute lymphoblastic leukaemia (ALL) for which there are limited treatment options known to provide clinical benefit. Eastern cooperative oncology group performance status ≤2. Performance status must not have deteriorated by ≥2 levels within 2 weeks after providing informed consent. Predicted life expectancy ≥8 weeks. Adequate organ function at screening as per the protocol defined criteria. Adequate cardiac function as demonstrated by LVEF > 50% on screening cardiac multigated acquisition, magnetic resonance image or echocardiogram. Willing and able to participate in all required study evaluations and procedures including receiving IV administration of study treatment and admission to the hospital, when required, for administration of study treatment and monitoring. For inclusion in the genetic component of the study, participants must fulfil protocol defined criteria. White blood cell count must be <10 x 10^9/L. Treatment with hydroxyurea during screening and Cycle 1 to achieve this level is permitted. Women of childbearing potential and men should use protocol defined contraceptive measures.  Exclusion Criteria:  Unresolved toxicity from prior anticancer therapy of Common Terminology Criteria for Adverse Events Grade ≥2. Participants with Grade 2 neuropathy or Grade 2 alopecia are eligible. Active idiopathic thrombocytopenic purpura. Stem cell transplant < 100 days prior to the first dose of study treatment. Immunosuppression for graft versus host disease (GVHD) or GVHD prophylaxis within 4 weeks prior to the first dose of study treatment. Active central nervous system (CNS) leukaemia/leptomeningeal disease/spinal cord compression. Participants who have a history of CNS leukaemia must be free of CNS leukaemia for >30 days prior to the first dose of study treatment, and the most recent 2 lumbar punctures must be negative for leukaemic cells, to be eligible. Known uncontrolled infection with cytomegalovirus (CMV) infection (positive CMV Immunoglobulin M (IgM) and/or positive polymerase chain reaction (PCR) result). Active infection including human immunodeficiency virus, Hepatitis B, Hepatitis C, or severe acute respiratory syndrome-coronavirus-2 (SARS-CoV-2). As judged by the Investigator: any evidence of severe or uncontrolled systemic diseases, (eg, severe hepatic impairment, interstitial lung disease [bilateral, diffuse, parenchymal lung disease]); current unstable or uncompensated respiratory or cardiac conditions; Uncontrolled hypertension; history of, or active, bleeding diatheses (eg, haemophilia or von Willebrand disease); uncontrolled active systemic fungal, bacterial, or other infection. Any of the given cardiac criteria: history of myocarditis within one year of study entry, or heart failure New York Heart Association Functional Classification Class 3 or 4; mean resting corrected QT interval (QTcF) ≥470 msec obtained from 3 electrocardiogram (ECGs), in the absence of a cardiac pacemaker; abnormalities in rhythm, conduction or morphology of resting ECG; any factors that increase the risk of QTc prolongation or risk of arrhythmic events such congenital long QT syndrome, family history of long QT syndrome, or unexplained sudden death under 40 years of age. History of another life-threatening malignancy ≤2 years prior to first dose of study treatment. The following are permitted: myelodysplastic syndrome or myeloproliferative neoplasm (including chronic myelomonocytic leukaemia [CMML]); malignancy treated with curative intent and with no evidence of active disease present for more than 2 years before screening and considered to be at low risk of recurrence by the treating physician; adequately treated lentigo malignant melanoma without current evidence of disease or adequately controlled non-melanomatous skin cancer; adequately treated carcinoma in situ without current evidence of disease. Any of the mentioned procedures or conditions currently or in the 6 months prior to the first dose of study treatment: coronary artery bypass graft; angioplasty; vascular stent; myocardial infarction; angina pectoris; haemorrhagic or thrombotic stroke, including transient ischaemic attacks or any other CNS bleeding. Treatment with any of the mentioned therapy: radiotherapy less than 3 weeks prior to first study treatment; chemotherapy within ≤14 days or 5 half-lives prior to the first dose of study treatment. Treatment with high-dose steroids for primary malignancy control is permitted but must be discontinued at least 2 days prior to the first dose of study treatment. Treatment with hydroxyurea is permitted; immunotherapies and cellular therapies within 4 weeks prior to the first dose of study treatment; investigational drugs within ≤14 days or 5 half-lives (whichever is shorter) prior to the first dose of study treatment; major surgery (excluding placement of vascular access) ≤21 days, or minor surgical procedures ≤7 days, prior to the first dose of study treatment. No waiting is required mentioned implantable port or catheter placement; prescription or non-prescription drugs or other products known to be sensitive substrates of BCRP, OCT2, OAT3, OATP1B1, OATP1B3, CYP2B6, CYP2C8, CYP2C9 or CYP2D6, or reversible moderate or strong CYP3A inhibitors, which cannot be discontinued within 5 half-lives prior to the first dose of study treatment and withheld throughout the study until 14 days after the last dose of AZD0466; moderate or strong mechanism-based inhibitors or inducers of CYP3A4 which cannot be discontinued within 5 half-lives plus of the specific drug 12 days of the drug prior to the first dose of study treatment and withheld until 14 days after the last dose of AZD0466; concurrent anti-coagulation therapy, including aspirin and heparin, which cannot be stopped; medications with known risk of Torsades de Pointes which cannot be discontinued within 5 half-lives of the first dose of study treatment and withheld until 14 days after the last dose of AZD0466; IV anti infection treatment within 14 days before first dose of study treatment. History of hypersensitivity to polyethylene glycol (PEG), PEGylated products or drugs with a similar chemical structure or class to AZD0466 or other BH3 mimetic.  Module 2:  • Patients for whom treatment with voriconazole is contraindicated per the local prescribing information must not enter the study.