Your dentist will remove decay from the tooth before a filling, using a local anesthetic to help with any pain.
Your dentist will prepare the tooth for the filling once all decay is removed. Different fillings require an array of procedures to make sure they will fit properly and stay that way, and your dentist may put in a liner or base within the tooth to protect the nerves.