While there is no sure way to prevent gastric cancer, certain lifestyle changes can reduce the risk. These include maintaining a healthy diet rich in fruits and vegetables, reducing intake of salted and smoked foods, quitting smoking, and managing Helicobacter pylori infections. Regular screenings and monitoring for those with a family history or genetic predisposition can also aid in early detection and prevention.