Is there a way to automatically reconnect WiFi if it shuts off?

I would start by disabling wifi powersave. Please post a full inxi output as nobody here can determine what chip we are talking about without one. To disable wifi power saving:

create this file if it does not exist.
/etc/NetworkManager/conf.d/default-wifi-powersave-off.conf

By default there is:

[connection]
wifi.powersave = 3

Change the value to 2. Reboot for the change to take effect.