Inclusion Criteria:  Participants have histologically proven diagnosis of unresectable metastatic colorectal cancer with a known rat sarcoma (RAS) mutation. Participants have measurable disease according to RECIST 1.1 criteria. Have received 2-3 prior lines of systemic anticancer treatment (adjuvant or neoadjuvant therapy is not counted as one line of systemic therapy). Participants with stable previously treated brain metastases are allowed. ECOG performance status of 0-2 at the time of screening. Age ≥ 18 years at the time of signing informed consent Life expectancy of at least 3 months. Female participants of childbearing potential must agree to use dual methods of contraception and have a negative serum pregnancy test at screening, and male participants must use an effective barrier method of contraception if sexually active throughout the study and for 4 months after the last dose of selinexor or pembrolizumab or 6 months after trifluridine and tipiracil. Written informed consent signed in accordance with federal, local, and institutional guidelines.  Exclusion Criteria:  Prior treatment with a selective inhibitor of nuclear export (SINE) compound or selinexor. Prior treatment with immune checkpoint inhibitors. Participants with microsatellite instability high (MSI-H) or deficient mismatch repair (dMMR). Known allergy to any of study drugs (selinexor, pembrolizumab, and trifluridine and tipiracil) or the excipient of pembrolizumab.  Significant cardiovascular impairment, defined as:  Left ventricular ejection fraction ≤ 40 percent (%) Active congestive heart failure (New York Heart Association [NYHA]) Class ≥ 3 Unstable angina or myocardial infarction within 3 months of enrollment Serious and potentially life-threatening arrhythmia  Impaired hematopoietic function (any of the following would result in exclusion):  Absolute neutrophil count (ANC) less than (<) 1500/cubic millimeter (mm^3) Platelet count < 100,000/ mm^3 Hemoglobin (Hb) < 10 gram per deciliter (g/dL) Significant renal impairment, defined as: calculated creatinine clearance (CrCl) of < 30 milliliter per minute (mL/min) using the formula of Cockcroft and Gault. Impaired hepatic function defined as: total bilirubin greater than (>) 1.5 × upper limit of normal (ULN) and aspartate transaminase (AST) > 2.5 x ULN, AST > 2.5 x ULN; for Arm B, unless bilirubin elevation is related to Gilbert's Syndrome for which bilirubin must be ≤ 4 x ULN.  Participants with a diagnosis of immunodeficiency or are receiving systemic steroid therapy (>10 mg/day of prednisone or equivalent) or any other form of immunosuppressive therapy. Participants with active autoimmune disease requiring systemic treatment during the past 2 years.  Participants with controlled type I and type II diabetes mellitus, and endocrinopathies such as hypothyroidism on stable hormone replacement, skin disorders (such as vitiligo, psoriasis, or alopecia) not requiring systemic treatment, or conditions not expected to recur in the absence of an external trigger are allowed.  Note: The Investigator needs to evaluate the participants medical history to confirm that they are eligible to receive the combination with pembrolizumab per these criteria.  Insufficient time since or not recovered from procedures or anti-cancer therapy, defined as:  Not recovered from major surgery ≤ 21 days prior to Day 1 dosing. Minor procedures, such as biopsies, dental work, or placement of a port or IV line for infusion are permitted. Have ongoing clinically significant anti-cancer therapy-related toxicities Common Terminology Criteria for Adverse Events (CTCAE) Grade > 1. In specific cases, participants whose toxicity has stabilized or with Grade 2 non-hematologic toxicities can be allowed following documented approval by the Sponsor's Medical Monitor. Had last dose of previous anti-cancer therapy ≤14 days prior to Day 1 dosing. Palliative radiotherapy > 14 days prior to the study is allowed. Received investigational drugs in other clinical trials within 28 days, or 5 half-lives of the investigational drug (whichever is shorter), prior to Cycle 1 Day 1 (C1D1). Live-attenuated vaccine against an infectious disease (e.g., nasal spray influenza vaccine) ≤ 14 days prior to the intended C1D1. Female participants who are pregnant or lactating. Active, ongoing or uncontrolled active infection requiring parenteral antibiotics, antivirals, antifungals within 1 week of Screening. Participants with autoimmune disease, a medical condition that requires systemic corticosteroids or other immunosuppressive medication; or a history of interstitial lung disease. Any gastrointestinal dysfunctions that could interfere with the absorption of selinexor (e.g. bowel obstruction, inability to swallow tablets, malabsorption syndrome, unresolved nausea, vomiting, diarrhea CTCAE > grade 1). In the opinion of the investigator, participants who are below their ideal body weight and would be unduly impacted by changes in their weight. Serious psychiatric or medical conditions that could interfere with participation in the study or in the opinion of the Investigator would make study involvement unreasonably hazardous. Concurrent therapy with approved or investigational anticancer therapeutic including topical therapies.