Most common fish sold in aquarium shops, especially those recommended for beginners, can subsist on processed (flake, stick or pellet) food. Some can even thrive on it, although for fish, just as for other animals, some variety in the diet is usually desirable.
Fish food is somewhat delicate. Exposing it to sunlight, leaving the lid off so that damp can come in, or buying a very large container that takes 8 months to use up all can sabotage the nutritional value of your fish's food. Generally speaking, there are four classes of fish food:
Processed foods (processed ground stuff remade into flakes, sticks or pellets; often divided into categories for omnivorous, vegetarian, and carnivorous fish).
To many fishkeepers, flake food is like rice. It will do for most every meal, but a little something else now and again is important. Nearly every new fishkeeper will hear the rule "feed your fish only what they will eat in 3 minutes" or similar. This is terrifying to the beginner; after all, those fish are obviously ravenous! What if they starved! This is only a tiny pinch! How can it be enough?
Take it seriously. The reason most folks have fish is, we hope, to observe them. If not up close and personal, at least in a general sense. The perfect time to do some of your observing is when you feed. Each time you feed, park yourself in front of the tank to watch. Put in less than you think can possibly be enough. Watch the fish consume it. Observe what falls to the bottom. If you don't have any fish that are primarily bottom feeders, take the time to learn if any of your other fish will clean the bottom. If you do have bottom feeders, watch to see how fast they eat.
So you put a little pinch in, and after 2 minutes (you counted!) there is practically no food to be seen, except a little on the bottom, which the bottom feeding fishes are really going for. It is better to feed a tiny bit several times a day, especially with fish that won't scour the bottom, than it is to feed a bunch all at once. But most adult fish will do fine being fed a 5 minute ration once a day. In an established tank, even less often feeding times are preferred by some fish keepers; that way, the fish will eat more of the algae and other edibles that can naturally occur in a tank.
Another thing to keep in mind is that fish can get fat, especially if fed a lot of rich foods such as bloodworms. Many of the fish you'll buy to put in your tank are juveniles. How they develop into adult fish will be determined by your care of them. Just as high nitrates, can stunt a fish's growth, shorten its life, and prevent it from ever breeding successfully, fish who are overfed can end up with deformed bodies and other problems plus they poop more. Feeding a good variety of foods ensures that your fish will get not only the rich foods, but also fiber and vegetables (algae, plants, etc.).