If you’ve done much woodworking, it’s very likely that you have experienced some dents and gouges. Both are flaws in the wood. But they are not the same thing, so they should be treated differently.
Dents are compressed wood. The wood fibers are still intact, just pressed down or indented. They can usually be steamed level. Gouges are also indentations, but the wood fibers have been torn and usually some of the wood has been removed. They have to be filled with wood putty or other filling material. Sometimes the indentation is not clearly a dent or a gouge, so you can try steaming before resorting to filling.
To steam out a dent, drip some water into the depression using an eyedropper or syringe. If the dent is shallow, the water may swell the wood enough to bring it level with the rest of the surface. If the water itself doesn’t work, try steaming. Drip some more water into the dent and cover the surface with a dry cloth. Then apply a medium hot iron to the cloth. The hot iron causes the water to turn to steam, which enters the wood and swells it. You can do this several times.
Whether using water or steam, sand the wood well after the moisture has dried out to eliminate any raised grain.
Because water raises the grain of wood, it’s best not to lay a wet cloth on a wide area of the wood, as is often recommended, before heating with the iron, because this will increase the amount of sanding necessary. It’s best to keep the wetted area as small as possible.
If the indentation is a gouge, you will need to fill it. Fillers don’t take stain like wood (no matter what manufacturers claim), so if you are staining, you should use a filler that is already close to the color of the stained wood. Practice on scrap to get a close match.
But the problem is that most woods change color as they age, so even if you get a good match originally, chances are the match won’t be so good after a few years. There’s no way around this. Just don’t gouge the wood.