Hi Tamil. As Harris suggests, both a healthy diet and healthy exercise are important to safe and effective weight loss. Here I’m answering your question using both diet and exercise as nouns so to speak.
If your question is treating the terms ‘diet’ and ‘exercise’ as verbs, then I would answer slightly differently. Then your question of ‘which is the BEST,’ either diet[ing] OR exercis[ing] would cause me to answer EXERCISING. Treating this question very literally, I generally answer when given only ONE choice of either diet or exercise, that exercise is perhaps the BEST way to reduce weight because with ‘proper’ exercise not only comes the potential for losing weight, but also perhaps more importantly, the potential to change your body composition (i.e. lean tissue versus body fat), which over the long term will be healthier than simple losing weight.
There’s a lot more to the answer to your question, but hopefully, the nuance in the difference between the two answers I’ve given above will make sense. Good luck!