Getting headless install to reconnect to wifi network after network goes away?


I have my RPi 3 running DietPi as a headless host and use my smartphone as a wifi hotspot/router. Sometimes when I leave and come back home a few hours later, the RPi will reconnect to the wifi hotspot, but it didn’t do so last night. Is there a way to ensure it will periodically look for the network and reconnect when the network becomes available?