Teach your child from an early age the importance of eating right and getting plenty of daily physical activity. Lead your child by setting a good example daily.
We are creatures that can be taught many things. Many of the things we like or dislike are actually just habits. Teach your kids to like fruits, vegetables and to lead a healthy active lifestyle. Their own decisions will be made as they get older but that early training will set the stage for life long good habits.
One of the worst things you can do is to be a hypocrite. This is true not only with diet and exercise issues but with your overall lifestyle too. For example, if you are a smoker, it is ok to tell your kids they shouldn't smoke, but if you don't want to seem like a hypocrite you shouldn't just 'order' them not to smoke. It's much better to talk to them honestly about the dangers of cigarettes and how you wish you had never started, etc.
It's also helpful to workout with your kids. From a young age include them in the activities that lead to a healthy lifestyle. Go to the gym together, take a workout or fitness class together, take martial arts or boxing classes together, go for a swim or play basketball together. Just get in the habit of spending time getting some exercise together.
You can also include them in the food planning. When they are old enough go through cook books with them and ask them to help you find new recipes to try. Let them come with you to the grocery store and teach them how to buy fruits and vegetables.
Many of these ideas can help you set your kids on a path that will be the foundation for a life time of better lifestyle choices... and it can be fun too.
Always encourage your kids to try new things, to try things that are healthy and good for them. Sometimes parents inadvertently blow off their kids and their ideas without really meaning too. For example, if your kid is kind of a clutz and they come to you and tell you they want to take martial arts lesson, don't laugh and remind them that they are a clutz, instead encourage them to give it a try.
It's easy to learn how to keep your child from becoming obese, the best way to do that is to be proactive and teach them good habits from the start.