Kindly get an X-ray
done of the tooth having pain
. If both are carious then you need to get the caries removed and get them filled with tooth coloured filling called as composites. If any of the tooth is infected till pulp which can be only seen in the X-ray then you may have to get root canal treatment
done followed by a crown/cap.
Brush your teeth twice daily using correct brushing technique to maintain your oral hygiene.