Only the dentist can detect if you have a cavity that needs to be filled. The type of treatment your dentist chooses will depend on the extent of damage caused by decay.
The dental cavity is filled with an acidic conditioner called an engraver. The engraver dissolves part of the mineral content of the enamel, creating a roughness of the surface at a microscopic level.
Teeth can be filled with Gold and Golden-based alloys, Porcelain, Silver amalgam (which consists of mercury mixed with silver, tin, zinc, and copper), or Tooth-colored, Plastic, and glass materials called Composite Resin Fillings. Each of these choices has their advantages and disadvantages.