dnd 5e – How do the material components of Heat Metal work?

The manufactured metal object is the target of the spell.

Heat metal says:

Choose a manufactured metal object, such as a metal weapon or a suit of heavy or medium metal armor, that you can see within range. You cause the object to glow red-hot.

So we are choosing a piece of manufactured metal we can see, and we are targeting it with the spell.

The iron and flame can be replaced by a component pouch or spellcasting focus.

A piece of iron and a flame are the components of the spell (and separate from the metal target of the spell). You need these two things to cast it. But they can be provided by a component pouch or spellcasting focus. The component pouch description says:

A component pouch is a small, watertight leather belt pouch that has compartments to hold all the material components and other special items you need to cast your spells, except for those components that have a specific cost (as indicated in a spell’s description).

So whatever you need to produce the flame required for heat metal is in there, and it’s probable a piece of flint to strike on the iron.

The rules also permit a focus to be used instead:

Casting some spells requires particular objects, specified in parentheses in the component entry. A character can use a component pouch or a spellcasting focus (found in “Equipment”) in place of the components specified for a spell.

If you don’t have a focus or component pouch, the rules aren’t crystal clear, but the rules for material components require a free hand, so “within reach” seems like the most reasonable ruling.