i would get some pain relievers, preferably chewabke ones, so they would dissolve quickly therefore work quickly.
if you get tooth pain and you know its cavities, then go to the doctor right away. severely damaged teeth can lead to death. you could get ice packs and put them on where it hurts.
dont eat too hot or too cold or it will hurt more.