Hi and welcome,
After the filling was dislodged from the tooth , the tooth must have undergone decay as it was exposed to oral environment due to lodgement of food debris and saliva. Carious process exposes the nerve tissue of the tooth and leads to pain and sensitivity.
You need to consult a dentist
, a x ray examination of the tooth will show the exact extent of pulpal damage accordingly root canal treatment
is done to remove the infected pulp followed by a permanent filling and restoring the tooth with a crown coverage .
Mean time you can have analgesic
to relieve the pain or use some desensitising agents but the tooth cannot be left open and should be restored in time before further damage.