For example, like meals, people in ancient times ate to live. Nowadays we live to eat.
Does 'For example' fit correctly with 'like meals'?
No. "For example" and "like" are redundant. If it were to be written properly, it would need to be "For example, meals..."
Even then it doesn't make a lot of sense. We know people eat meals. The entire "For example, like meals" doesn't add any information to the sentence at all.
For example, people ate meals in ancient times in order to live. Nowadays we live to eat.
Are the revised sentences fine?