Eligibility Criteria:
Inclusion Criteria:
* Must have a histologically confirmed diagnosis of advanced (metastatic or unresectable) soft tissue sarcoma with one of the following subtypes:
* Leiomyosarcoma
* Liposarcoma
* Subject must be clinically indicated to receive trabectedin therapy as part of routine care. Subjects may be first line, or have received any number of prior systemic therapies
* Total bilirubin level =\< 1.5 x the upper limit of normal (ULN) mg/dL
* Aspartate aminotransferase (AST) =\< 2.5 x ULN and alanine aminotransferase (ALT) =\< 2.5 x ULN
* Alkaline phosphatase \< 2.5 x ULN
* Serum creatinine =\< 1.5 x ULN
* Calculated creatinine clearance \>= 30 mL/min using the Cockcroft-Gault formula may be included
* Creatinine phosphokinase (CPK) =\< 2.5 x ULN
* Absolute neutrophil count (ANC) \>= 1.5 x 10\^9/L
* Platelet count \>= 100,000/mm\^3 (100 x 10\^9/L)
* Hemoglobin \>= 9 g/dL
* Subject must demonstrate a left ventricular ejection fraction (LVEF) \> 45% by echocardiography (ECHO) or multigated acquisition scan (MUGA)
* Male or non-pregnant and non-breast feeding female:
* Females of child-bearing potential must agree to use highly effective contraception without interruption from initiation of therapy and while on study medication and have a negative serum pregnancy test (beta - human chorionic gonadotropin \[hCG\]) result at screening and agree to ongoing pregnancy testing during the course of the study, and at the end of study treatment; a highly effective method of contraception is defined as one that results in a low failure rate (that is, \< 1% per year), when used consistently and correctly, such as implants, injectables, combined oral contraceptives, some intrauterine contraceptive devices, sexual abstinence, or a vasectomized partner
* Male subjects must practice abstinence or agree to use a condom during sexual contact with a pregnant female or a female of childbearing potential while participating in the study
* All ongoing toxicities related to prior therapies must be resolved to grade 1 or better (except alopecia)
* Subject must have an Eastern Cooperative Oncology Group (ECOG) performance status =\< 1 or Karnofsky performance scale \>= 70
* Subjects must have one or more measurable lesions, as determined by Response Evaluation Criteria in Solid Tumors (RECIST) version (v)1.1 assessed by computed tomography (CT) or magnetic resonance imaging (MRI)
* Subjects must have a life expectancy of \>= 6 months, as determined by the treating physician
* Ability to understand and sign informed consent document
* Willingness and ability to comply with the scheduled visits, laboratory tests, and other study procedures
Exclusion Criteria:
* Known active, uncontrolled, or symptomatic central nervous system (CNS) metastases; a subject with controlled and asymptomatic CNS metastases may participate in this study; as such, the subject must have completed any prior treatment for CNS metastases \>= 28 days (including radiotherapy and/or surgery) prior to the start of treatment in this study and should not be receiving chronic corticosteroid therapy in excess of 10 mg daily prednisone (or equivalent) for CNS metastases; subjects with known CNS metastases must be confirmed radiographically stable by at least one imaging study, at least 28 days from last treatment
* Receipt of any type of cytotoxic, biologic, or other systemic anticancer therapy (including investigational) within 2 weeks of enrollment
* Prior organ transplantation, including allogeneic stem cell transplantation
* Prior treatment with trabectedin
* Significant acute or chronic infections including, among others:
* Known history of testing positive test for human immunodeficiency virus (HIV) or known acquired immunodeficiency syndrome (AIDS)
* Known active infection with hepatitis B or hepatitis C
* Active autoimmune disease that might deteriorate when receiving an immunostimulatory agent:
* Subjects with diabetes type I, vitiligo, psoriasis, hypo- or hyperthyroid disease not requiring immunosuppressive treatment are eligible
* Subjects requiring hormone replacement with corticosteroids are eligible if the steroids are administered only for the purpose of hormonal replacement and at doses =\< 10 mg or 10 mg equivalent prednisone per day
* Administration of steroids through a route known to result in a minimal systemic exposure (topical, intranasal, introocular, or inhalation) are acceptable
* Known severe hypersensitivity reactions to monoclonal antibodies (grade \>= 3 National Cancer Institute \[NCI\] Common Terminology Criteria for Adverse Events \[CTCAE\] version \[v\] 5.0), any history of anaphylaxis, or uncontrolled asthma (that is, 3 or more features of partially controlled asthma)
* Pregnant or lactating females
* Known, active alcohol or drug abuse
* All other significant diseases (for example, inflammatory bowel disease, uncontrolled asthma), which, in the opinion of the investigator, might impair the subject's tolerance of trial treatment
* Any vaccination within 4 weeks of the first dose of avelumab, with the following exceptions:
\* Administration of inactivated vaccines, including inactivated flu vaccines, are allowable; however, they should not be given within 2 weeks prior to starting study treatment
* Clinically significant cardiovascular disease including cerebral vascular accident/stroke (\< 6 months prior to enrollment), myocardial infarction (\< 6 months prior to enrollment), congestive heart failure with New York Heart Association (NYHA) class II or greater or serious cardiac arrhythmia requiring medication
* Severe (requiring active treatment) acute or chronic medical conditions including: colitis, inflammatory bowel disease, pneumonitis, or pulmonary fibrosis
* Recent (within the past year) or active suicidal ideation or behavior