My friend had diabetes. I always hear people asking him to go on a diet. How diet helps people with diabetes?

Two ways. For someone with type 2 diabetes, diet helps in two ways. First any diet that leads to weight loss will make a person more sensitive to Insulin so that lower amounts of Insulin and/or medications will control their sugars more easily. Secondly, limiting the amount of sugar and starch (that breaks down to sugar) at a meal, keeps the sugar from spiking up after a meal.
Lowers sugar level. The "diet" to follow with diabetes is a low glycemic diet which means the food you are eating, does not get turned into sugar quickly. This means eat lean protein, veggies, most fruit in moderation, nuts/seeds/ and whole grains. Foods high in sugar convert to very high levels of sugar causing swings in blood sugar. Avoid processed foods, sugary drinks, breads, and white rice/flour.