Sotorasib works by specifically binding to the KRAS G12C mutant protein, thereby inhibiting its function. KRAS is a part of the RAS family of proteins, which play a critical role in cell signaling pathways that control cell growth and survival. Mutations in KRAS can lead to uncontrolled cell proliferation, a hallmark of cancer. By inhibiting this mutated protein, sotorasib disrupts these aberrant signaling pathways, thereby inhibiting tumor growth.