Most plankton, known as phytoplankton, (but not all) eat in much the same way as do plants - through photosynthesis, the process by which sunlight is converted into food energy.
More
Planktonic animals mostly eat other plankton, incluing the planktonic plants described above, and smaller animals which are also plankton. The smallest of the plankton can eat bacteria and detritus, but the largest of the plankton are true predators. These kind of plankton are called zooplankton, because they are animals.
Phytoplankton eat small bacteria, which eat decomposing matter. They are in the blue whale's food chain.