hi and welcome to HCM,
Pain and discomfort in a restored tooth indicates presence of infection hat may spread to the surrounding periondontal tissue via root apex .
you need to get an x ray
done for your tooth which will show the extent of infection and the tissues involved.
accordingly filling is replaced and root canal
procedure is done which will remove the infected nerve
,cleaning and shaping of the canals is done is the root apex is sealed.
This procedure devitalises the tooth and sets it pain free permanently and visit a dentist
and get it done.
Meantime you can have analgesics for pain relief.