It is not possible to prevent Type 1 diabetes mellitus. On the other hand, Type 2 diabetes can be prevented very effectively by eliminating the main cause: being overweight.
The best way to lose weight (also for people affected by diabetes) is to permanently change the food one consumes: lots of fruit, vegetables, and whole products, less fat and easily digested carbohydrates. With intensive diets first you will lose a lot of weight, but in the long run strict weight loss cures are ineffective. As soon as the original food is returned to the diet, the weight also returns, usually even more than before.
It is recommended to take a balanced and varied diet that does not require expensive special products, can be maintained permanently, and tastes good.
However, food not the only factor in declaring war against being overweight. If you want to lose weight and maintain a normal weight, you are also almost obligated to increase your physical activity. The ideal is a resistance/weight training of about half an hour a day with intensity of between low and medium. Strength training with muscle development also helps to lose weight since muscle cells burn many carbohydrates even at rest.
With a lot of exercise, it is possible to prevent Type 2 diabetes. Training makes the cells more sensitive to insulin. If you cannot lose weight yourself, it is worth asking the doctor for help. This help can come in many ways: from good advice to drug treatment in case of obesity.
It seems that stress favors the development of Type 2 diabetes. Many people resort to relaxation techniques such as Tai-Chi or yoga to be calmer and handle daily loads more relaxed.