Blackworms and Tubifex can live in the substrate of an aquarium. Blackworms are better and cleaner. Buy some from a petshop, rinse well under clean tap water. Then add to a tank. They live in the gravel and feed on fish food or anything in the gravel. If you set up a tank and add worms first. Then wait a month before adding fish, the worms will usually be well established and continue growing. However, Corydoras and loaches will find most of them and eat them.
If you do buy blackworms or tubifex, make sure there are no brown or grey worms in the clump. These are dead and rotting and an indication the worm holding facility at the shop needs a clean.