Issues: Missing commas to separate items in a list, and “for example” should be followed by a comma. The sentence is also too long without proper punctuation.
Corrected version: I like to cook different kinds of food, for example, pasta, pizza, and salad. But sometimes, I don’t have enough time to prepare them.