To avoid diabetes mellitus, particularly Type 2, maintaining a healthy lifestyle is essential. This includes eating a balanced diet, staying physically active, managing body weight, and avoiding habits like smoking, which can increase the risk of developing the condition. Regular health checkups and monitoring blood sugar levels can also help in early detection and prevention.