The Babylonians took Daniel and his friends to Babylon as captives, because the king wanted them to serve in his court.
This meant that Daniel and his friends would have to be trained in the ways of the Babylonians, including their diet.
However, Daniel objected to the diet of the Babylonians, because it violated the laws of God (Daniel 1:10). Therefore, he made a request to the man in charge,
“Please test your servants for ten days, and let them give us vegetables to eat and water to drink. Then let our appearance be examined before you, and the appearance of the young men who eat the portion of the king’s delicacies; and as you see fit, so deal with your servants” (Daniel 1:12-13).
The man agreed and after ten days, he discovered that Daniel and his friends looked better, and so the steward complied with Daniel and gave what he wanted to eat.
As servants of God today we will need to be tested, and we should go through it willingly, knowing that if we follow the Scriptures, we will come out victorious.
By the way, try eating more fruits and vegetables and see how it improves your health.