A filling may be used to physically bond any holes in a tooth, preventing further cavities or erosion. Using a local anesthetic to help with any uncomfortableness, your dentist will remove decay from the tooth before a filling it, preserving the healthy areas.
Then, your dentist will prepare the tooth for the filling once all decay is removed. Depending on the type of filling, it may require an array of procedures to make sure it will fit properly, your dentist may also place a liner or base within the tooth to protect nerves in the tooth.