Inclusion Criteria:
* B-cell malignancy.
* Patients must have received prior therapy.
* Patients must have an objective indication for therapy.
* Eastern Cooperative Oncology Group performance status (ECOG PS) of 0-1.
* Anticipated life expectancy of greater than or equal to (≥) 12 weeks.
* Adequate bone marrow function.
* Adequate hepatic function.
* Creatinine clearance of ≥ 60 milliliters (mL)/minute.
* Ability to swallow tablets.
* Ability to comply with outpatient treatment, laboratory monitoring, and required clinic visits for the duration of study participation.
* Prior treatment-related adverse events (AEs) must have recovered to grade less than or equal to (≤) 1 or pretreatment baseline, with the exception of alopecia.
* Men with partners of childbearing potential or women of childbearing potential (WOCBP) must agree to use highly effective birth control.
* WOCBP must not be pregnant.
* Additional Inclusion Criteria for Patients with AL Amyloidosis
* In Part 1 Dose Expansion, patients with AL amyloidosis are eligible based on prior detection of primary systemic light-chain amyloidosis.
* Must have measurable disease of AL amyloidosis.
* Prior local fluorescence in-situ hybridization (FISH) testing results for t(11;14) are required to be submitted prior to enrollment.
Exclusion Criteria:
* Prior to identification of an appropriate RP2D (Dose Expansion) of LOXO-338, a history of known, active or suspected:
* Richter's transformation to diffuse large B-cell lymphoma (DLBCL), prolymphocyticleukemia, or Hodgkin lymphoma
* Transformed low grade lymphoma
* Burkitt or Burkitt-like lymphoma
* Diffuse large B-cell lymphoma
* AL amyloidosis
* Multiple myeloma
* Lymphoblastic lymphoma or leukemia
* Posttransplant lymphoproliferative disorder
* Known or suspected history of central nervous system (CNS) involvement.
* History of allogeneic or autologous stem cell transplant (SCT) or chimeric antigen receptor-modified T cell (CAR-T) therapy within the past 60 days and with any of the following:
* Active graft versus host disease (GVHD)
* Cytopenias from incomplete blood cell count recovery post-transplant or CAR-T therapy
* Need for anti-cytokine therapy for toxicity from CAR-T therapy; residual symptoms of neurotoxicity Grade \> 1 from CAR-T therapy
* Ongoing immunosuppressive therapy
* Known human immunodeficiency virus (HIV) positive, regardless of cluster of differentiation 4 (CD4) count. Unknown or negative status eligible.
* Inability to take necessary uric acid lowering agents (i.e., allopurinol, rasburicase, orfebuxostat).
* Concurrent anticancer therapy.
* Concurrent treatment with strong cytochrome P450 3A4 (CYP3A4) inhibitors or inducers that can include antifungals.
* Use of ≥ 20 milligrams (mg) prednisone once a day (QD) or equivalent dose of steroid per day, within 7 days of start of study treatment. Patients may not be on any dose of prednisone intended for antineoplastic use.
* Vaccination with a live vaccine within 28 days prior to start of study therapy.
* Major surgery within four weeks of planned start of study therapy Prolongation of the QT interval corrected by Fridericia's Formula for heart rate (QTcF) greater than (\>) 470 milliseconds (msec).
* Clinically significant cardiovascular disease.
* Female patient who is pregnant or lactating.
* Active second malignancy which may preclude assessment of DLT.
* Clinically significant active malabsorption syndrome including surgical resection of small intestine or other condition likely to affect gastrointestinal (GI) absorption of the orally administered study drugs.
* Active hepatitis B or C infection.
* Evidence of other clinically significant uncontrolled condition(s) including, but not limited to, uncontrolled systemic infection (viral, bacterial, or fungal) or other clinically significant active disease process.
* Active uncontrolled auto-immune cytopenia.
* Additional Exclusion Criteria for Patients with AL Amyloidosis (Part 1 Dose-Expansion)
* Previous or current diagnosis of symptomatic MM.
* Heart failure that, in the opinion of the Investigator, is on the basis of ischemic heart disease.
* Supine systolic blood pressure \< 90 mmHg, or symptomatic orthostatic hypotension in the absence of volume depletion.
* N-terminal pro hormone natriuretic peptide (NT-proBNP) \> 8500 ng/L (or BNP \> 700 ng/L if NT-proBNP is not available by local or central testing).
* Additional exclusion criteria for patients enrolled to part 2: LOXO-338 and pirtobrutinib combination
* Prior progression or intolerance to pirtobrutinib.
* Patients requiring therapeutic anticoagulation with warfarin.
* Known hypersensitivity to any component or excipient of pirtobrutinib.
* In patients with history of myocardial infarction or congestive heart failure, documented left ventricular ejection fraction (LVEF) by any method of ≤ 45 percent (%) in the 12 months prior to planned start of study treatment.
* History of uncontrolled or symptomatic arrhythmias including grade ≥ 3 arrhythmia on a prior BTK inhibitor.
* History of major bleeding on a prior BTK inhibitor.
* Current treatment with strong permeability glycoprotein (P-gp) inhibitors.