connect to hotspot immediately

Hi guys.

How do i program the arduino to connect to my hotspot automatically if my wifi is down?

i would like to know

char ssid[] = "firstNetwork";     //  your network SSID (name)
char pass[] = "firstPassword";  // your network password
char ssid2[] = "secondNetwork";
char pass[] = "secondPassword";

from here what's the next step?

thanks in advance