Gestational diabetes

Na

Is there any way you can prevent yourself from getting gestational diabetes or is it something that just happens? I had it with my last baby and I worry I’ll get it again😖 I’m avoiding the doughnuts and junk food as hard as I can lol