Rybelsus works by mimicking the action of a hormone called glucagon-like peptide-1 (GLP-1). By activating GLP-1 receptors, Rybelsus helps regulate blood sugar levels by increasing insulin secretion, decreasing glucagon production, and slowing down gastric emptying.