How do you repair a metal door?

I’m sure this has been asked a thousand times but I can’t seem to figure it out, thanks!

Place metal fragments in the hotbar, then look at the door and press the number.

If the door is damaged, it will give you a message in chat, telling you how much you have healed it for, and how much health it has. 1000 is maximum health, and you heal 100-200 hp with 100 metal fragments, so it is very expensive.