Changing the way you cook could help reduce your risk of getting type 2 diabetes, a new study suggests.