Having a family history of diabetes, especially type 2, does increase your risk of developing the condition. Genes play a significant role in predisposing you to insulin resistance and problems with insulin production. However, it's absolutely not inevitable that you will get diabetes.
Think of your genes as loading the gun, but lifestyle factors pull the trigger. By adopting a healthy lifestyle, you can significantly reduce your risk, even with a strong family history. This includes maintaining a healthy weight, eating a balanced diet rich in fruits, vegetables, and whole grains, engaging in regular physical activity, and managing stress.
For type 1 diabetes, the genetic link is less direct, and it's believed that environmental triggers play a more significant role in initiating the autoimmune attack. While having a family history increases the risk slightly, it's not the primary determining factor.
So, while you can't change your genes, you have considerable power over your lifestyle, which can make a huge difference in your risk of developing diabetes.