Life style and social environment of the child plays an important role in diet of a 2 year old. There are a few things you can do to help him continue this healthy eating trend all through his life. For example;
- Be very careful in selecting the restaurants you go together. You can secretly tell the waiter the foods you don't want him to bring to the table. (You may warn the waiter that you don't want regular bread, cube sugar, chocolate on the side of coffee or you want the meat to be served with potato salad or vegetables instead of french fries.) 
- If your child is going to play dates, you may track the snacks or lunch served there and even request the monthly or weekly menus from responsible persons. You may ask how the dishes are cooked and you may contact with other parents to request a few changes from the management. (Whole wheat bread  and healthy snacks, restriction of sugar consumption) Most child get accustomed to many thing in nurseries. For example don't be surprised when you see your child eat the whole plate of spinach while he used to hate it in the past. So try to play an active role in food and beverage policies of the school and make sure your child is fed healthy and nutritious foods.
A child that is 2 - 3 years old starts to say “no” a lot as she wants to "make a difference". And this may turn the meals into nightmares for mothers. In this period usually the child is the one who wins the fight at home. At the end all mothers can do is to get angry and lose their nerves. Gurme Bebek recommends mothers to respect preferences of their child and not to force their child to eat. Instead of teaching how to bargain to your child by telling her "I will give you cookie if you eat your broccoli", just give her healthy cookies you bake at home. You may even make one meal the cookie time for your child. Otherwise it is a matter of time for you to hear "I am not going to eat my beans if you don't give me chocolate."
Set very few rules about eating but consistently apply the ones you set. If you told your child that "eating while watching TV is forbidden" don't unbend and let her watch TV when she skips lunch and is hungry. Just wait and you will see eat her dinner. No child wants to stay hungry.
A balanced strictness is a good policy to follow when your child is choosy in eating. If your child does not like a vegetable, there is no problem in giving her another vegetable that she likes. Just like grownups, kids don't have to love everything. However when you put vegetables in front of him and he says "I don't want it, make me spaghetti", don't run to make him spaghetti. Offer your child two alternatives right at the beginning, he will choose between those two. If he does not eat again, take his plate off the table and skip that meal.
Try to serve the vegetables he refuses in different forms. For example try to add a vegetable he does not like, into omelet or vegetable patties or even meatballs. Especially if there is something he specifically dislikes, don't give him that for a while and hope he will forget it in time.
 Click here for diet table for age 2.

Since your baby socializes more as of month 24, it would be inevitable for them to eat unhealthy foods occasionally. Tolerate this and don't make a big deal out of it. As long as most of his dishes are healthy...