There are numerous kinds of fish food availible today. The most popular types are flakes, pelets and sticks, freeze-dried food, frozen food, live food, and homemade food.
Flakes are the staple food for the majority of fishkeepers and their fish. That, however, does not mean that they are the best, or even good. If used properly, flakes can be a great part of your fish's diet. But if you buy a can of flakes from 1980 at a garage sale and expect your fish to do fine, you will be sadly disappointed.
Just like human food, flakes loose quality if they remain opened for too long. Therefore, unless you have a lot of fish, refrain from that temptation to buy flakes in great bulk, and let them sit opened until they are consumed. The way I do it is buy enough food for several months, and keep only a small portion of it near the fish. The rest stays in the freezer, which should hopefully preserve the vitamins in the food.
The type of food is also very important. It is very important that you purchase the proper type of flakes for your fish -- buying goldfish flakes for tropical fish, or cichlid sticks for swordtails results in poorely fed fish. Beside that, try to stick to decent brands of food -- Tetra and Wardly are a few of the big ones. Don't go to Walmart and buy the cheapest food possible, but also, don't spend too much money on food. It is important, but so are many other things. Remeber, the point of fishkeeping is not to be the biggest spender in the neighborhood.
Sticks and pellets
This class of fish food contains the various dried food that is packaged in sticks, pellets, balls, wafers, or any other odd packaging the manufacturer invents. There are a variety of floating sticks, some designed for cichlids and other for large pond fish like goldfish and koi. Floating sticks are OK, but for goldfish, they may be quite unhealthy. If you do feed your goldfish sticks(floating or sinking) soak them in water first, because if the fish eat the sticks before they soak up enough water, there might be problems.
A special type of food is algae wafers. They are designed to be fed to algae eating fish such as plecos and ottos, but in my experience, other bottom feeding fish like them too. Don't expect the wafers to do wonders for your algae eating fish, but they are good as a supplement to real algae.
Several organisms are availible as fish food in freeze-dried form. I recomend the various freeze-dried worms over crustatians; in my experience, dauphnia and brine shrimp tend to be worse foods. This is largely due to their small size. When you buy freeze-dried foods, it may come as a can/box of cubes. To feed your fish, simply take one or several cubes and stick them onto the aquarium glass. It may be quite hard to get them to stick even when fish are tugging at them but it is possible. Don't rely on freeze-dried foods as sole foods for your fish, as your fish need variety.
Frozen food can be a good option but does require a bit more work than flakes or pellets. Frozen foods come in several varieties and packaging types. My favorite packaging type is the frozen cubes. You can just drop a frozen cube into a dixie cup of tank water to dethaw it.
Live food is perhaps the best of all the fish foods, but unfortunatly, it is quite expensive and difficult to use every day. For larger fish, smaller feeder fish are the best live food -- the big cichlids love eating goldfish. For smaller fish, there is a variety of foods.
This salt water crustatian can be hatched from dried eggs, or purchased in a fully grown state. It is possible to grow brine shrimp to adulthood, but it is quite difficult and space consuming. Baby brine shrimp are great for raising small fry, who greatly enjoy this nutritious food. And bigger fish love adult brine shrimp. However, if your fish are above 3-4 inches, even adult brine shrip are probably too small for them. BTW, non-fishkeepers sometimes call brine shrimp sea monkeys.
The former makes its sewer its home; the latter resides in far cleaner environments. But both worms, if clean, are a great food for many fish. Cory cats love them, as do many other bottom feeders; for top feeders, you will need to buy or make a feeder so that the worms do not down to the bottom too quickly. You can make one out of the cap from a 2L Coke bottle -- just drill several holes, put the cap into the water with the top of the cap on the bottom, and put the worms into the cap. They will wrigle around and slowly fall through the holes -- to the fish.
There are several methods for keeping the worms alive. You can just keep them in water in the refrigerator, but take them out at least once a day pour a string jet of water into the can/jar they are in, in order to break up the clump. Then, turn down the water, and the dead ones will float to the top and over the sides of the jar. Pour off excess water and return them to the fridge.
Another method is to keep the jar in the bathroom, under a dripping faucet, so that the worms would be getting constant changes of water. Yet another method involves tightly covering the jar with fabric, and laying it on its side into the tank above your toilet. That way, they will have a large supply of water, and every time you flush the toilet, the worms will get a water change. In both the cases, however, you will need to wash them with the jet of water, but they will usually last longer if stored under a dripping faucet or the toilet tank.
As any fisherman knows, fish love earthworms. However, for most aquarium fish, there is a problem -- size. If you can get tiny worms from somewhere by all means feed them to your fish. Or if you have larger fish, even big worms will do. However, you should clean them first, by placing them into cooked oatmeal for a day. This will clear out their guts, and prevent your fish from eating the dirt that the worms eat in the wild.
Culturing earthworms is a tricky business. I've heard it is easy, and although I've never seriously tried, and the one time I did try, all of my worms died(or somehow escaped). Here is a method for culturing them, but bewarned -- I can not attest to its functionality.
The basic container for worms can be anything -- a wood box is the usual choice. It needs to have holes drilled into it for drainage, and then it needs to be filled with soil. Apparently, soil mixed with peat moss works. Add worms(at least 15-20 to get started), and make sure that you keep the soil moist. However, flooding is a serious threat(and is probably the reason for my failure), so make sure that the soil is not constantly soaked.
A good food for the worms is supposed to be corn meal. It is what I used in my attempt(but you are aware of how my culturing attempt failed). Basically, a lot of different powedered foods will work -- just make a small hole, put the food there, and fill the hole with earth.