As a cellular protease, transmembrane serine protease 2 (TMPRSS2) plays roles in various physiological and pathological processes, including cancer and viral entry, such as severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). Herein, we conducted expression, mutation, and prognostic analyses for the TMPRSS2 gene in pan-cancers as well as in COVID-19-infected lung tissues. The results indicate that TMPRSS2 expression was highest in prostate cancer. A high expression of TMPRSS2 was significantly associated with a short overall survival in breast invasive carcinoma (BRCA), sarcoma (SARC), and uveal melanoma (UVM), while a low expression of TMPRSS2 was significantly associated with a short overall survival in lung adenocarcinoma (LUAD), demonstrating TMPRSS2 roles in cancer patient susceptibility and severity. Additionally, TMPRSS2 expression in COVID-19-infected lung tissues was significantly reduced compared to healthy lung tissues, indicating that a low TMPRSS2 expression may result in COVID-19 severity and death. Importantly, TMPRSS2 mutation frequency was significantly higher in prostate adenocarcinoma (PRAD), and the mutant TMPRSS2 pan-cancer group was significantly associated with long overall, progression-free, disease-specific, and disease-free survival rates compared to the wild-type (WT) TMPRSS2 pan-cancer group, demonstrating loss of functional roles due to mutation. Cancer cell lines were treated with small molecules, including cordycepin (CD), adenosine (AD), thymoquinone (TQ), and TQFL12, to mediate TMPRSS2 expression. Notably, CD, AD, TQ, and TQFL12 inhibited TMPRSS2 expression in cancer cell lines, including the PC3 prostate cancer cell line, implying a therapeutic role for preventing COVID-19 in cancer patients. Together, these findings are the first to demonstrate that small molecules, such as CD, AD, TQ, and TQFL12, inhibit TMPRSS2 expression, providing novel therapeutic strategies for preventing COVID-19 and cancers.