The basic rule is that the juvenile turtles are carnivores (they eat meat) and the adults are omnivores (they eat meat and veggies). A variety of foods should be offered, and you ought to have at least six or seven kinds of food on hand for your turtle at any given time. A high-quality turtle pellet may form the base of the diet, to which you may add low-salt cat kibble, strawberries, leafy vegetables, several pondweeds, valisneria, fish, crickets, swatted flies (not poisoned ones!), shrimp, and mosquito larvae.
There is one vital difference between freshwater turtles and their land-loving relatives the tortoises, when it comes to feeding. The freshwater turtles need to be able to submerge themselves in water, in order to eat. If they stay out of water too long, they will dry out and die, but it is open to question whether they will dry out or starve first. Either way, it would be a very painful way to die. Always make sure your turtle has access to water, and a way to climb out of the water to avoid drowning.