You are basically mentioning 2 differe nt types of pain. Hot or cold pain is basically sensitivity you are having and the night pain is due to decay in some tooth. It is also possible for both to coexist. For the sensitivity try using a sensitive toothpaste but for the night you may have to undergo a root canal treatment.
Next Steps
Visit an endodontist at the earliest, they may be able to save the tooth