If your iPhone is trying to connect to any unwanted wireless network then you can remove this WiFi network from your device. To remove WiFi Network from your iPhone you can simply do that from WiFi Settings. Follow this guide to remove WiFi network from iPhone so you can connect automatically to the right wireless network.
Remove Wi-Fi Network from iPhone
Tap on Settings icon from home screen
Tap Wi-Fi option
Here you will see the list of Wireless networks, tap on the arrow icon to remove a WiFi Network
Here, tap on “Forget this Network” button and then “Forget”, this will stop joining to selected WiFi network automatically.