The best thing you can do to prevent gingivitis is to practice good dental hygiene. This includes brushing at least twice a day, flossing, and scheduling a professional cleaning twice a year.
Ways to help stop gingivitis before it develops:
The single biggest thing you can do is to keep your teeth clean. Brush twice a day, floss daily, and get your teeth cleaned twice a year. But beyond that you can also eating the right foods, avoid sticky and sugary foods. Also smoking is a big no no.