Add secondary wifi credentials

Hi, so right now my wifi is broken (no internet connection). I was thinking perhaps I could use a sim card with data to provide a temporary hotspot for emergency situations like this one. But how would I setup hassio so that “if first wifi doesn’t work (or doesn’t have active Internet connection), then try connect to the secondary hotspot network?” .The idea is that if no internet is available, then I can manually turn the hotspot on on a smartphone and use that one instead.
I’m on RPi 4 if it matters.

Any suggestion is welcome.
Thanks

Use an Ethernet cable for your main network connection (which you really should anyway) and then have your WI-FI setup only for your backup.

I do something similar for my trailer system; it connects to my home network when I’m home.