Composting worms eat kitchen scraps and produce worm castings, a genuinely excellent soil amendment. It works indoors, on a balcony, in a flat, but understand that you are keeping livestock, not running a process. Below: how vermicomposting works in practice, what it demands of you, and who it actually suits.
Vermicomposting.
The worms
Not earthworms from the garden. You want composting species — Eisenia fetida (tiger or brandling worms) or Eisenia hortensis. Garden earthworms are soil dwellers and will die in a bin.
What they need
Bedding: damp, carbon-rich material they live in and eat, see worm bin bedding.
Food: vegetable and fruit scraps, coffee grounds, in modest amounts. Overfeeding is the most common failure.
Moisture and temperature: damp but not wet, 15-25°C. They will not survive freezing or a hot conservatory.
What to keep out
Meat, dairy, oil, large amounts of citrus or onion, and anything salty. A worm bin is a small closed system and it is far easier to unbalance than a garden heap.
What you get
Worm castings: nutrient-dense, biologically active, and best used sparingly as a top dressing rather than as a growing medium. Plus leachate from the tap, which is not ‘worm tea’ and should be diluted heavily if used at all.
The honest downside: a worm bin needs attention every week or two, will not take garden waste, and can die. It is the right answer for a flat with no outdoor space and the wrong answer for a garden.