A use of ovatodiolide for preparing a composition used for inhibiting protein synthesis of gastric Helicobacter pylori, wherein the ovatodiolide achieves an effect of inhibiting gastric Helicobacter pylori by inhibiting the expression of 30S ribosomes RpsB of gastric Helicobacter pylori and further inhibiting its protein synthesis.