One of the issues of network quality is the number of wifi hotspot around. Sometimes, your phone automatically connects to a wifi network (if you saved the network and its credential), this might be an issue when you don’t want the phone to do it as wifi quality wasn’t good. There is a ways to disable the automatic joining:
In iOS: go to Settings >> Wifi >> select the network >> select the (i) >> Turn off Auto-Join.
In Android: it depends on the devices/Android version. Some devices only allow you to “forget” the network but not disabling “auto connect”. You could check it in the settings >> WIFI >> click on the WIfi network and see what options you can have. Also select the tri-dot on the top right of the WIFI Tab >> select Advanced. There could be other way to stop the device to automatically to join a network.